Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 17 for readFrom (0.18 sec)

  1. src/bufio/bufio_test.go

    	n, err := w.Write([]byte("0123456789"))
    	if n != 10 || err != nil {
    		t.Fatalf("Write returned (%v, %v), want (10, nil)", n, err)
    	}
    
    	// Use ReadFrom to read in some data.
    	n2, err := w.ReadFrom(strings.NewReader("abcdef"))
    	if n2 != 6 || err != nil {
    		t.Fatalf("ReadFrom returned (%v, %v), want (6, nil)", n2, err)
    	}
    }
    
    type emptyThenNonEmptyReader struct {
    	r io.Reader
    	n int
    }
    
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Fri Feb 10 18:56:01 GMT 2023
    - 51.5K bytes
    - Viewed (0)
  2. internal/http/response-recorder.go

    var ErrNotImplemented = errors.New("not implemented")
    
    // ReadFrom implements support for calling internal io.ReaderFrom implementations
    // returns an error if the underlying ResponseWriter does not implement io.ReaderFrom
    func (lrw *ResponseRecorder) ReadFrom(r io.Reader) (int64, error) {
    	if lrw.ReaderFrom != nil {
    		n, err := lrw.ReaderFrom.ReadFrom(r)
    		lrw.bytesWritten += int(n)
    		return n, err
    	}
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Sat Dec 02 00:13:19 GMT 2023
    - 4.9K bytes
    - Viewed (0)
  3. src/bufio/bufio.go

    	n := copy(b.buf[b.n:], s)
    	b.n += n
    	nn += n
    	return nn, nil
    }
    
    // ReadFrom implements [io.ReaderFrom]. If the underlying writer
    // supports the ReadFrom method, this calls the underlying ReadFrom.
    // If there is buffered data and an underlying ReadFrom, this fills
    // the buffer and writes it before calling ReadFrom.
    func (b *Writer) ReadFrom(r io.Reader) (n int64, err error) {
    	if b.err != nil {
    		return 0, b.err
    	}
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Thu Oct 12 14:39:08 GMT 2023
    - 21.8K bytes
    - Viewed (0)
  4. src/bytes/buffer_test.go

    func TestReadFromPanicReader(t *testing.T) {
    
    	// First verify non-panic behaviour
    	var buf Buffer
    	i, err := buf.ReadFrom(panicReader{})
    	if err != nil {
    		t.Fatal(err)
    	}
    	if i != 0 {
    		t.Fatalf("unexpected return from bytes.ReadFrom (1): got: %d, want %d", i, 0)
    	}
    	check(t, "TestReadFromPanicReader (1)", &buf, "")
    
    	// Confirm that when Reader panics, the empty buffer remains empty
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Thu Apr 20 01:07:29 GMT 2023
    - 18.1K bytes
    - Viewed (0)
  5. src/bytes/buffer.go

    	}
    	return copy(b.buf[m:], s), nil
    }
    
    // MinRead is the minimum slice size passed to a Read call by
    // [Buffer.ReadFrom]. As long as the [Buffer] has at least MinRead bytes beyond
    // what is required to hold the contents of r, ReadFrom will not grow the
    // underlying buffer.
    const MinRead = 512
    
    // ReadFrom reads data from r until EOF and appends it to the buffer, growing
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Fri Oct 13 17:10:31 GMT 2023
    - 15.7K bytes
    - Viewed (0)
  6. src/archive/tar/writer.go

    	if err != nil && err != ErrWriteTooLong {
    		tw.err = err
    	}
    	return n, err
    }
    
    // readFrom populates the content of the current file by reading from r.
    // The bytes read must match the number of remaining bytes in the current file.
    //
    // If the current file is sparse and r is an io.ReadSeeker,
    // then readFrom uses Seek to skip past holes defined in Header.SparseHoles,
    // assuming that skipped regions are all NULs.
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Fri Oct 13 18:36:46 GMT 2023
    - 19.6K bytes
    - Viewed (0)
  7. src/archive/tar/writer_test.go

    					}
    				case testReadFrom:
    					f := &testFile{ops: tf.ops}
    					got, err := tw.readFrom(f)
    					if _, ok := err.(testError); ok {
    						t.Errorf("test %d, ReadFrom(): %v", i, err)
    					} else if got != tf.wantCnt || !equalError(err, tf.wantErr) {
    						t.Errorf("test %d, ReadFrom() = (%d, %v), want (%d, %v)", i, got, err, tf.wantCnt, tf.wantErr)
    					}
    					if len(f.ops) > 0 {
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Tue Feb 27 16:39:23 GMT 2024
    - 38.7K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/math/PairedStats.java

            "Expected PairedStats.BYTES = %s, got %s",
            BYTES,
            byteArray.length);
        ByteBuffer buffer = ByteBuffer.wrap(byteArray).order(ByteOrder.LITTLE_ENDIAN);
        Stats xStats = Stats.readFrom(buffer);
        Stats yStats = Stats.readFrom(buffer);
        double sumOfProductsOfDeltas = buffer.getDouble();
        return new PairedStats(xStats, yStats, sumOfProductsOfDeltas);
      }
    
      private static final long serialVersionUID = 0;
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Fri May 12 17:02:53 GMT 2023
    - 12.6K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/hash/BloomFilter.java

     * has not actually been put in the {@code BloomFilter}.
     *
     * <p>Bloom filters are serializable. They also support a more compact serial representation via the
     * {@link #writeTo} and {@link #readFrom} methods. Both serialized forms will continue to be
     * supported by future versions of this library. However, serial forms generated by newer versions
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 23.1K bytes
    - Viewed (0)
  10. api/go1.15.txt

    pkg net/url, method (*URL) EscapedFragment() string
    pkg net/url, method (*URL) Redacted() string
    pkg net/url, type URL struct, RawFragment string
    pkg os, method (*File) ReadFrom(io.Reader) (int64, error)
    pkg os, var ErrDeadlineExceeded error
    pkg regexp, method (*Regexp) SubexpIndex(string) int
    pkg strconv, func FormatComplex(complex128, uint8, int, int) string
    Plain Text
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Fri Jul 17 02:15:01 GMT 2020
    - 7.6K bytes
    - Viewed (0)
Back to top