Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for openStream (0.09 sec)

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

      }
    
      @Override
      public void setUp() throws IOException {
        source = factory.createSource(data);
      }
    
      public void testOpenStream() throws IOException {
        InputStream in = source.openStream();
        try {
          byte[] readBytes = ByteStreams.toByteArray(in);
          assertExpectedBytes(readBytes);
        } finally {
          in.close();
        }
      }
    
    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-tests/test/com/google/common/io/ByteSourceTest.java

        // Slice it starting at offset 10.
        ByteSource slice = source.slice(10, 5);
    
        // Open a stream to the slice.
        InputStream in = slice.openStream();
    
        // Append 10 more bytes to the source.
        source.append(newPreFilledByteArray(5, 10));
    
        // The stream reports no bytes... importantly, it doesn't read the byte at index 5 when it
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Tue May 07 15:26:58 UTC 2024
    - 15.4K bytes
    - Viewed (0)
  3. android/guava-testlib/src/com/google/common/testing/ArbitraryInstances.java

        }
      }
    
      private static final class NullByteSink extends ByteSink implements Serializable {
        private static final NullByteSink INSTANCE = new NullByteSink();
    
        @Override
        public OutputStream openStream() {
          return ByteStreams.nullOutputStream();
        }
      }
    
      // Compare by toString() to satisfy 2 properties:
      // 1. compareTo(null) should throw NullPointerException
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Apr 17 16:33:44 UTC 2024
    - 20.5K bytes
    - Viewed (0)
  4. android/guava-tests/test/com/google/common/io/CharSourceTest.java

        // read the first 8 chars manually, since there's no equivalent to ByteSource.slice
        // TODO(cgdecker): Add CharSource.slice?
        StringBuilder builder = new StringBuilder();
        Reader reader = concatenated.openStream(); // no need to worry about closing
        for (int i = 0; i < 8; i++) {
          builder.append((char) reader.read());
        }
        assertEquals(expected, builder.toString());
      }
    
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Tue May 07 15:26:58 UTC 2024
    - 10.5K bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/io/IoTestCase.java

        for (int i = 0; i < size; i++) {
          array[i] = (byte) (offset + i);
        }
        return array;
      }
    
      private static void copy(URL url, File file) throws IOException {
        InputStream in = url.openStream();
        try {
          OutputStream out = new FileOutputStream(file);
          try {
            byte[] buf = new byte[4096];
            for (int read = in.read(buf); read != -1; read = in.read(buf)) {
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Fri May 31 12:36:13 UTC 2024
    - 5.6K bytes
    - Viewed (0)
Back to top