Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 41 for ByteArrayOutputStream (0.2 sec)

  1. 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 May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 8.6K bytes
    - Viewed (0)
  2. 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)
  3. 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 May 03 12:43:13 GMT 2024
    - Last Modified: Tue Feb 27 09:26:07 GMT 2024
    - 5.2K bytes
    - Viewed (0)
  4. 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 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 8.6K bytes
    - Viewed (0)
  5. guava-testlib/src/com/google/common/testing/Platform.java

    final class Platform {
      /** Serializes and deserializes the specified object. */
      @SuppressWarnings("unchecked")
      static <T> T reserialize(T object) {
        checkNotNull(object);
        ByteArrayOutputStream bytes = new ByteArrayOutputStream();
        try {
          ObjectOutputStream out = new ObjectOutputStream(bytes);
          out.writeObject(object);
          ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bytes.toByteArray()));
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Aug 23 12:13:11 GMT 2023
    - 1.7K bytes
    - Viewed (0)
  6. android/guava-testlib/src/com/google/common/testing/Platform.java

    final class Platform {
      /** Serializes and deserializes the specified object. */
      @SuppressWarnings("unchecked")
      static <T> T reserialize(T object) {
        checkNotNull(object);
        ByteArrayOutputStream bytes = new ByteArrayOutputStream();
        try {
          ObjectOutputStream out = new ObjectOutputStream(bytes);
          out.writeObject(object);
          ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bytes.toByteArray()));
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Aug 23 12:13:11 GMT 2023
    - 1.7K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/hash/AbstractByteHasherTest.java

        assertThrows(IndexOutOfBoundsException.class, () -> hasher.putBytes(new byte[8], 0, -1));
      }
    
      private class TestHasher extends AbstractByteHasher {
    
        private final ByteArrayOutputStream out = new ByteArrayOutputStream();
    
        @Override
        protected void update(byte b) {
          out.write(b);
        }
    
        @Override
        protected void update(byte[] b, int off, int len) {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 3.8K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/io/ByteSourceTest.java

      public void testOpenBufferedStream() throws IOException {
        InputStream in = source.openBufferedStream();
        assertTrue(source.wasStreamOpened());
        assertFalse(source.wasStreamClosed());
    
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        ByteStreams.copy(in, out);
        in.close();
        out.close();
    
        assertTrue(source.wasStreamClosed());
        assertArrayEquals(bytes, out.toByteArray());
      }
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 16.9K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/io/FilesTest.java

        assertEquals(I18N + I18N + I18N, Files.toString(temp, Charsets.UTF_16LE));
      }
    
      public void testCopyToOutputStream() throws IOException {
        File i18nFile = getTestFile("i18n.txt");
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        Files.copy(i18nFile, out);
        assertEquals(I18N, out.toString("UTF-8"));
      }
    
      public void testCopyToAppendable() throws IOException {
        File i18nFile = getTestFile("i18n.txt");
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 22.2K bytes
    - Viewed (0)
  10. guava-tests/test/com/google/common/io/LittleEndianDataInputStreamTest.java

     */
    public class LittleEndianDataInputStreamTest extends TestCase {
    
      private byte[] data;
    
      @Override
      protected void setUp() throws Exception {
        super.setUp();
    
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        DataOutputStream out = new DataOutputStream(baos);
    
        initializeData(out);
    
        data = baos.toByteArray();
      }
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 4.8K bytes
    - Viewed (0)
Back to top