Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 21 for ByteSource (0.05 sec)

  1. android/guava/src/com/google/common/io/ByteSource.java

       *
       * @param sources the sources to concatenate
       * @return a {@code ByteSource} containing the concatenated data
       * @since 15.0
       */
      public static ByteSource concat(Iterable<? extends ByteSource> sources) {
        return new ConcatenatedByteSource(sources);
      }
    
      /**
       * Concatenates multiple {@link ByteSource} instances into a single source. Streams returned from
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:26:48 UTC 2024
    - 26.2K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/io/ByteSourceTest.java

      public void testConcat() throws IOException {
        ByteSource b1 = ByteSource.wrap(new byte[] {0, 1, 2, 3});
        ByteSource b2 = ByteSource.wrap(new byte[0]);
        ByteSource b3 = ByteSource.wrap(new byte[] {4, 5});
    
        byte[] expected = {0, 1, 2, 3, 4, 5};
    
        assertArrayEquals(expected, ByteSource.concat(ImmutableList.of(b1, b2, b3)).read());
        assertArrayEquals(expected, ByteSource.concat(b1, b2, b3).read());
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:26:48 UTC 2024
    - 15.4K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/io/ByteSourceTest.java

      public void testConcat() throws IOException {
        ByteSource b1 = ByteSource.wrap(new byte[] {0, 1, 2, 3});
        ByteSource b2 = ByteSource.wrap(new byte[0]);
        ByteSource b3 = ByteSource.wrap(new byte[] {4, 5});
    
        byte[] expected = {0, 1, 2, 3, 4, 5};
    
        assertArrayEquals(expected, ByteSource.concat(ImmutableList.of(b1, b2, b3)).read());
        assertArrayEquals(expected, ByteSource.concat(b1, b2, b3).read());
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:26:48 UTC 2024
    - 15.4K bytes
    - Viewed (0)
  4. android/guava-tests/test/com/google/common/io/SourceSinkFactories.java

        @Override
        public void tearDown() throws IOException {}
      }
    
      private static class ByteArraySourceFactory implements ByteSourceFactory {
    
        @Override
        public ByteSource createSource(byte[] bytes) throws IOException {
          return ByteSource.wrap(bytes);
        }
    
        @Override
        public byte[] getExpected(byte[] bytes) {
          return bytes;
        }
    
        @Override
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:26:48 UTC 2024
    - 12.6K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/io/SourceSinkFactories.java

        @Override
        public void tearDown() throws IOException {}
      }
    
      private static class ByteArraySourceFactory implements ByteSourceFactory {
    
        @Override
        public ByteSource createSource(byte[] bytes) throws IOException {
          return ByteSource.wrap(bytes);
        }
    
        @Override
        public byte[] getExpected(byte[] bytes) {
          return bytes;
        }
    
        @Override
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:26:48 UTC 2024
    - 17.7K bytes
    - Viewed (0)
  6. guava/src/com/google/common/io/CharSource.java

     * be an empty line at the end if the contents are terminated with a line separator.
     *
     * <p>Any {@link ByteSource} containing text encoded with a specific {@linkplain Charset character
     * encoding} may be viewed as a {@code CharSource} using {@link ByteSource#asCharSource(Charset)}.
     *
     * <p><b>Note:</b> In general, {@code CharSource} is intended to be used for "file-like" sources
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Oct 31 14:20:11 UTC 2024
    - 25.5K bytes
    - Viewed (0)
  7. guava-tests/test/com/google/common/io/MoreFilesTest.java

      public void testByteSource_size_ofDirectory() throws IOException {
        try (FileSystem fs = Jimfs.newFileSystem(Configuration.unix())) {
          Path dir = fs.getPath("dir");
          Files.createDirectory(dir);
    
          ByteSource source = MoreFiles.asByteSource(dir);
    
          assertThat(source.sizeIfKnown()).isAbsent();
    
          assertThrows(IOException.class, () -> source.size());
        }
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Oct 17 02:42:09 UTC 2024
    - 27.4K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/io/FilesTest.java

        suite.addTestSuite(FilesTest.class);
        return suite;
      }
    
      public void testRoundTripSources() throws Exception {
        File asciiFile = getTestFile("ascii.txt");
        ByteSource byteSource = Files.asByteSource(asciiFile);
        assertSame(byteSource, byteSource.asCharSource(UTF_8).asByteSource(UTF_8));
      }
    
      public void testToByteArray() throws IOException {
        File asciiFile = getTestFile("ascii.txt");
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Jul 23 14:22:54 UTC 2024
    - 22.1K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/io/MoreFilesTest.java

      public void testByteSource_size_ofDirectory() throws IOException {
        try (FileSystem fs = Jimfs.newFileSystem(Configuration.unix())) {
          Path dir = fs.getPath("dir");
          Files.createDirectory(dir);
    
          ByteSource source = MoreFiles.asByteSource(dir);
    
          assertThat(source.sizeIfKnown()).isAbsent();
    
          assertThrows(IOException.class, () -> source.size());
        }
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Oct 31 16:07:00 UTC 2024
    - 26.5K bytes
    - Viewed (0)
  10. guava-testlib/src/com/google/common/testing/ArbitraryInstances.java

              .put(FloatBuffer.class, FloatBuffer.allocate(0))
              .put(DoubleBuffer.class, DoubleBuffer.allocate(0))
              .put(File.class, new File(""))
              .put(ByteSource.class, ByteSource.empty())
              .put(CharSource.class, CharSource.empty())
              .put(ByteSink.class, NullByteSink.INSTANCE)
              .put(CharSink.class, NullByteSink.INSTANCE.asCharSink(UTF_8))
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:26:48 UTC 2024
    - 21.2K bytes
    - Viewed (0)
Back to top