Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 52 for ByteArrayOutputStream (0.18 sec)

  1. guava-tests/test/com/google/common/io/CountingOutputStreamTest.java

    import static org.junit.Assert.assertThrows;
    
    import java.io.ByteArrayOutputStream;
    
    /**
     * Unit tests for {@link CountingOutputStream}.
     *
     * @author Chris Nokleberg
     */
    public class CountingOutputStreamTest extends IoTestCase {
    
      public void testCount() throws Exception {
        int written = 0;
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        CountingOutputStream counter = new CountingOutputStream(out);
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 1.9K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/io/CountingOutputStreamTest.java

    import static org.junit.Assert.assertThrows;
    
    import java.io.ByteArrayOutputStream;
    
    /**
     * Unit tests for {@link CountingOutputStream}.
     *
     * @author Chris Nokleberg
     */
    public class CountingOutputStreamTest extends IoTestCase {
    
      public void testCount() throws Exception {
        int written = 0;
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        CountingOutputStream counter = new CountingOutputStream(out);
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 1.9K bytes
    - Viewed (0)
  3. android/guava-testlib/src/com/google/common/collect/testing/ReserializingTestCollectionGenerator.java

        return reserialize(delegate.create(elements));
      }
    
      @SuppressWarnings("unchecked")
      static <T> T reserialize(T object) {
        try {
          ByteArrayOutputStream bytes = new ByteArrayOutputStream();
          ObjectOutputStream out = new ObjectOutputStream(bytes);
          out.writeObject(object);
          ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bytes.toByteArray()));
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Fri Oct 01 17:18:04 GMT 2021
    - 2.5K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/hash/AbstractNonStreamingHashFunctionTest.java

        @Override
        public int bits() {
          return 32;
        }
    
        @Override
        public Hasher newHasher() {
          return new AbstractStreamingHasher(4, 4) {
            final ByteArrayOutputStream out = new ByteArrayOutputStream();
    
            @Override
            protected HashCode makeHash() {
              return HashCode.fromBytes(out.toByteArray());
            }
    
            @Override
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 4.4K bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/hash/AbstractNonStreamingHashFunctionTest.java

        @Override
        public int bits() {
          return 32;
        }
    
        @Override
        public Hasher newHasher() {
          return new AbstractStreamingHasher(4, 4) {
            final ByteArrayOutputStream out = new ByteArrayOutputStream();
    
            @Override
            protected HashCode makeHash() {
              return HashCode.fromBytes(out.toByteArray());
            }
    
            @Override
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 4.4K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/io/LittleEndianDataOutputStreamTest.java

    import java.io.ByteArrayInputStream;
    import java.io.ByteArrayOutputStream;
    import java.io.DataInput;
    import java.io.DataInputStream;
    import java.io.IOException;
    import junit.framework.TestCase;
    
    /**
     * Test class for {@link LittleEndianDataOutputStream}.
     *
     * @author Keith Bottner
     */
    public class LittleEndianDataOutputStreamTest extends TestCase {
    
      private ByteArrayOutputStream baos = new ByteArrayOutputStream();
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 4.7K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/io/SourceSinkFactories.java

          }
        }
    
        @Override
        public byte[] getSinkContents() throws IOException {
          File file = getFile();
          InputStream in = new FileInputStream(file);
          ByteArrayOutputStream out = new ByteArrayOutputStream();
          byte[] buffer = new byte[100];
          int read;
          while ((read = in.read(buffer)) != -1) {
            out.write(buffer, 0, read);
          }
          return out.toByteArray();
        }
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Apr 06 12:56:11 GMT 2023
    - 12.7K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/io/ByteSourceTester.java

      }
    
      public void testCopyTo_outputStream() throws IOException {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        source.copyTo(out);
        assertExpectedBytes(out.toByteArray());
      }
    
      public void testCopyTo_byteSink() throws IOException {
        final ByteArrayOutputStream out = new ByteArrayOutputStream();
        // HERESY! but it's ok just for this I guess
        source.copyTo(
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 8.6K bytes
    - Viewed (0)
  9. guava-testlib/src/com/google/common/collect/testing/ReserializingTestCollectionGenerator.java

        return reserialize(delegate.create(elements));
      }
    
      @SuppressWarnings("unchecked")
      static <T> T reserialize(T object) {
        try {
          ByteArrayOutputStream bytes = new ByteArrayOutputStream();
          ObjectOutputStream out = new ObjectOutputStream(bytes);
          out.writeObject(object);
          ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bytes.toByteArray()));
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Fri Oct 01 17:18:04 GMT 2021
    - 2.5K bytes
    - Viewed (0)
  10. android/guava-tests/test/com/google/common/collect/MultimapBuilderTest.java

        assertEquals(object.getClass(), copy.getClass());
      }
    
      @J2ktIncompatible
      @GwtIncompatible // serialization
      private static Object reserialize(Object object) throws Exception {
        ByteArrayOutputStream bytes = new ByteArrayOutputStream();
        new ObjectOutputStream(bytes).writeObject(object);
        return new ObjectInputStream(new ByteArrayInputStream(bytes.toByteArray())).readObject();
      }
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Feb 27 09:26:07 GMT 2024
    - 5.2K bytes
    - Viewed (0)
Back to top