Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 32 for ByteArrayOutputStream (1.36 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(
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Sep 06 17:04:31 UTC 2023
    - 8.6K bytes
    - Viewed (0)
  2. 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()));
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Aug 23 12:13:11 UTC 2023
    - 1.7K bytes
    - Viewed (0)
  3. 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()));
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Aug 23 12:13:11 UTC 2023
    - 1.7K bytes
    - Viewed (0)
  4. 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);
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Sep 06 17:04:31 UTC 2023
    - 1.9K bytes
    - Viewed (0)
  5. 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()));
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Tue Jun 11 16:13:05 UTC 2024
    - 2.4K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/io/ByteStreams.java

      public static ByteArrayDataOutput newDataOutput(ByteArrayOutputStream byteArrayOutputStream) {
        return new ByteArrayDataOutputStream(checkNotNull(byteArrayOutputStream));
      }
    
      private static class ByteArrayDataOutputStream implements ByteArrayDataOutput {
    
        final DataOutput output;
        final ByteArrayOutputStream byteArrayOutputStream;
    
        ByteArrayDataOutputStream(ByteArrayOutputStream byteArrayOutputStream) {
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Jan 17 18:59:58 UTC 2024
    - 29.7K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/io/ByteStreamsTest.java

     *
     * @author Chris Nokleberg
     */
    public class ByteStreamsTest extends IoTestCase {
    
      public void testCopyChannel() throws IOException {
        byte[] expected = newPreFilledByteArray(100);
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        WritableByteChannel outChannel = Channels.newChannel(out);
    
        ReadableByteChannel inChannel = Channels.newChannel(new ByteArrayInputStream(expected));
        ByteStreams.copy(inChannel, outChannel);
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Sep 06 17:04:31 UTC 2023
    - 21.9K bytes
    - Viewed (0)
  8. 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");
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Sep 06 17:04:31 UTC 2023
    - 22.2K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/io/ResourcesTest.java

        assertEquals("ALICE'S ADVENTURES IN WONDERLAND", result.get(0));
        assertEquals("THE END", result.get(result.size() - 1));
      }
    
      public void testCopyToOutputStream() throws IOException {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        URL resource = getClass().getResource("testdata/i18n.txt");
        Resources.copy(resource, out);
        assertEquals(I18N, out.toString("UTF-8"));
      }
    
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Sep 06 17:04:31 UTC 2023
    - 6.8K bytes
    - Viewed (0)
  10. guava/src/com/google/common/io/FileBackedOutputStream.java

      @GuardedBy("this")
      @CheckForNull
      private MemoryOutput memory;
    
      @GuardedBy("this")
      @CheckForNull
      private File file;
    
      /** ByteArrayOutputStream that exposes its internals. */
      private static class MemoryOutput extends ByteArrayOutputStream {
        byte[] getBuffer() {
          return buf;
        }
    
        int getCount() {
          return count;
        }
      }
    
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Thu Feb 22 17:40:56 UTC 2024
    - 8.2K bytes
    - Viewed (0)
Back to top