Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 36 for ByteSource (0.19 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
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed May 17 14:35:11 GMT 2023
    - 26.2K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/io/ByteSourceTester.java

      }
    
      // Test that you can not expand the readable data in a previously sliced ByteSource.
      public void testSlice_constrainedRange() throws IOException {
        long size = source.read().length;
        if (size >= 2) {
          ByteSource sliced = source.slice(1, size - 2);
          assertEquals(size - 2, sliced.read().length);
          ByteSource resliced = sliced.slice(0, size - 1);
          assertTrue(sliced.contentEquals(resliced));
        }
    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)
  3. guava-tests/test/com/google/common/io/FileBackedOutputStreamTest.java

        ByteSource source = out.asByteSource();
        int chunk1 = Math.min(dataSize, fileThreshold);
        int chunk2 = dataSize - chunk1;
    
        // Write just enough to not trip the threshold
        if (chunk1 > 0) {
          write(out, data, 0, chunk1, singleByte);
          assertTrue(ByteSource.wrap(data).slice(0, chunk1).contentEquals(source));
        }
        File file = out.getFile();
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 5.5K bytes
    - Viewed (0)
  4. guava-tests/benchmark/com/google/common/io/ByteSourceAsCharSourceReadBenchmark.java

            } else {
              return TO_BYTE_ARRAY_NEW_STRING.read(byteSource, cs);
            }
          }
        };
    
        abstract String read(ByteSource byteSource, Charset cs) throws IOException;
      }
    
      @Param({"UTF-8"})
      String charsetName;
    
      @Param ReadStrategy strategy;
    
      @Param({"10", "1024", "1048576"})
      int size;
    
      Charset charset;
      ByteSource data;
    
      @BeforeExperiment
      public void setUp() {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Oct 10 19:45:10 GMT 2022
    - 5.2K bytes
    - Viewed (0)
  5. android/guava-tests/benchmark/com/google/common/io/ByteSourceAsCharSourceReadBenchmark.java

            } else {
              return TO_BYTE_ARRAY_NEW_STRING.read(byteSource, cs);
            }
          }
        };
    
        abstract String read(ByteSource byteSource, Charset cs) throws IOException;
      }
    
      @Param({"UTF-8"})
      String charsetName;
    
      @Param ReadStrategy strategy;
    
      @Param({"10", "1024", "1048576"})
      int size;
    
      Charset charset;
      ByteSource data;
    
      @BeforeExperiment
      public void setUp() {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Oct 10 19:45:10 GMT 2022
    - 5.2K bytes
    - Viewed (0)
  6. 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());
    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)
  7. 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());
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 16.9K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/io/MultiInputStreamTest.java

        joinHelper(1, 1, 1, 1, 1, 1, 1, 1);
        joinHelper(1, 0, 1, 0, 1, 0, 1, 0);
      }
    
      public void testOnlyOneOpen() throws Exception {
        final ByteSource source = newByteSource(0, 50);
        final int[] counter = new int[1];
        ByteSource checker =
            new ByteSource() {
              @Override
              public InputStream openStream() throws IOException {
                if (counter[0]++ != 0) {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 4.6K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/io/MultiInputStreamTest.java

        joinHelper(1, 1, 1, 1, 1, 1, 1, 1);
        joinHelper(1, 0, 1, 0, 1, 0, 1, 0);
      }
    
      public void testOnlyOneOpen() throws Exception {
        final ByteSource source = newByteSource(0, 50);
        final int[] counter = new int[1];
        ByteSource checker =
            new ByteSource() {
              @Override
              public InputStream openStream() throws IOException {
                if (counter[0]++ != 0) {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 4.6K bytes
    - Viewed (0)
  10. guava-tests/test/com/google/common/io/TestCharSource.java

      private final TestByteSource byteSource;
    
      public TestCharSource(String content, TestOption... options) {
        this.byteSource = new TestByteSource(content.getBytes(UTF_8), options);
      }
    
      @Override
      public boolean wasStreamOpened() {
        return byteSource.wasStreamOpened();
      }
    
      @Override
      public boolean wasStreamClosed() {
        return byteSource.wasStreamClosed();
      }
    
      @Override
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Fri Nov 09 21:39:24 GMT 2012
    - 1.4K bytes
    - Viewed (0)
Back to top