Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for readFrom (0.27 sec)

  1. 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 30 11:13:12 GMT 2024
    - Last Modified: Thu Oct 12 14:39:08 GMT 2023
    - 21.8K bytes
    - Viewed (0)
  2. 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 30 11:13:12 GMT 2024
    - Last Modified: Fri Apr 26 13:31:36 GMT 2024
    - 18.6K bytes
    - Viewed (0)
  3. 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 30 11:13:12 GMT 2024
    - Last Modified: Fri Oct 13 18:36:46 GMT 2023
    - 19.6K bytes
    - Viewed (0)
  4. 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 30 11:13:12 GMT 2024
    - Last Modified: Fri Oct 13 17:10:31 GMT 2023
    - 15.7K bytes
    - Viewed (0)
  5. 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 30 11:13:12 GMT 2024
    - Last Modified: Tue Feb 27 16:39:23 GMT 2024
    - 38.7K bytes
    - Viewed (0)
  6. 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)
  7. 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)
  8. android/guava/src/com/google/common/math/Stats.java

        checkNotNull(byteArray);
        checkArgument(
            byteArray.length == BYTES,
            "Expected Stats.BYTES = %s remaining , got %s",
            BYTES,
            byteArray.length);
        return readFrom(ByteBuffer.wrap(byteArray).order(ByteOrder.LITTLE_ENDIAN));
      }
    
      /**
       * Creates a Stats instance from the byte representation read from the given {@link ByteBuffer}.
       *
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Feb 15 16:12:13 GMT 2024
    - 22K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/hash/BloomFilterTest.java

          bf.put(Ints.toByteArray(i));
        }
    
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        bf.writeTo(out);
    
        BloomFilter<byte[]> read =
            BloomFilter.readFrom(new ByteArrayInputStream(out.toByteArray()), funnel);
        assertThat(read).isEqualTo(bf);
        assertThat(read.expectedFpp()).isGreaterThan(0);
      }
    
      /**
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Thu Nov 09 22:49:56 GMT 2023
    - 21.3K bytes
    - Viewed (0)
  10. android/guava-tests/test/com/google/common/hash/BloomFilterTest.java

          bf.put(Ints.toByteArray(i));
        }
    
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        bf.writeTo(out);
    
        BloomFilter<byte[]> read =
            BloomFilter.readFrom(new ByteArrayInputStream(out.toByteArray()), funnel);
        assertThat(read).isEqualTo(bf);
        assertThat(read.expectedFpp()).isGreaterThan(0);
      }
    
      /**
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Nov 09 22:49:56 GMT 2023
    - 21.3K bytes
    - Viewed (0)
Back to top