Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 23 for asByteSource (0.23 sec)

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

          throws IOException {
        byte[] data = newPreFilledByteArray(dataSize);
        FileBackedOutputStream out = new FileBackedOutputStream(fileThreshold, resetOnFinalize);
        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);
    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)
  2. android/guava-tests/test/com/google/common/io/FileBackedOutputStreamTest.java

          throws IOException {
        byte[] data = newPreFilledByteArray(dataSize);
        FileBackedOutputStream out = new FileBackedOutputStream(fileThreshold, resetOnFinalize);
        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);
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 5.5K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/io/Files.java

       * @since 12.0
       * @deprecated Prefer {@code asByteSource(file).hash(hashFunction)}.
       */
      @Deprecated
      @InlineMe(
          replacement = "Files.asByteSource(file).hash(hashFunction)",
          imports = "com.google.common.io.Files")
      public
      static HashCode hash(File file, HashFunction hashFunction) throws IOException {
        return asByteSource(file).hash(hashFunction);
      }
    
      /**
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Feb 15 16:12:13 GMT 2024
    - 33.1K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/io/Resources.java

        }
    
        @Override
        public String toString() {
          return "Resources.asByteSource(" + url + ")";
        }
      }
    
      /**
       * Returns a {@link CharSource} that reads from the given URL using the given character set.
       *
       * @since 14.0
       */
      public static CharSource asCharSource(URL url, Charset charset) {
        return asByteSource(url).asCharSource(charset);
      }
    
      /**
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Feb 28 20:13:02 GMT 2023
    - 7.4K bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/io/SourceSinkFactories.java

        checkNotNull(factory);
        return new ByteSourceFactory() {
          @Override
          public ByteSource createSource(byte[] data) throws IOException {
            return factory.createSource(new String(data, Charsets.UTF_8)).asByteSource(Charsets.UTF_8);
          }
    
          @Override
          public byte[] getExpected(byte[] data) {
            return factory.getExpected(new String(data, Charsets.UTF_8)).getBytes(Charsets.UTF_8);
          }
    
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Apr 06 12:56:11 GMT 2023
    - 12.7K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/io/FileBackedOutputStream.java

       * the {@link ByteSource} returned by {@link #asByteSource} is finalized.
       *
       * @param fileThreshold the number of bytes before the stream should switch to buffering to a file
       * @param resetOnFinalize if true, the {@link #reset} method will be called when the {@link
       *     ByteSource} returned by {@link #asByteSource} is finalized.
       * @throws IllegalArgumentException if {@code fileThreshold} is negative
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Feb 22 17:40:56 GMT 2024
    - 8.2K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/io/CharSourceTest.java

      public static TestSuite suite() {
        TestSuite suite = new TestSuite();
        for (boolean asByteSource : new boolean[] {false, true}) {
          suite.addTest(
              CharSourceTester.tests(
                  "CharSource.wrap[CharSequence]",
                  SourceSinkFactories.stringCharSourceFactory(),
                  asByteSource));
          suite.addTest(
              CharSourceTester.tests(
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 12K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/io/MoreFilesTest.java

          assertThat(MoreFiles.equal(fooPath, barPath)).isFalse();
          assertThat(MoreFiles.equal(fooPath, fooPath)).isTrue();
          assertThat(MoreFiles.asByteSource(fooPath).contentEquals(MoreFiles.asByteSource(fooPath)))
              .isTrue();
    
          Path fooCopy = Files.copy(fooPath, fs.getPath("fooCopy"));
          assertThat(Files.isSameFile(fooPath, fooCopy)).isFalse();
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Jan 29 22:57:05 GMT 2024
    - 27.2K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/io/FilesTest.java

        return suite;
      }
    
      public void testRoundTripSources() throws Exception {
        File asciiFile = getTestFile("ascii.txt");
        ByteSource byteSource = Files.asByteSource(asciiFile);
        assertSame(byteSource, byteSource.asCharSource(Charsets.UTF_8).asByteSource(Charsets.UTF_8));
      }
    
      public void testToByteArray() throws IOException {
        File asciiFile = getTestFile("ascii.txt");
        File i18nFile = getTestFile("i18n.txt");
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 22.2K bytes
    - Viewed (0)
  10. android/guava-tests/test/com/google/common/io/FilesTest.java

        return suite;
      }
    
      public void testRoundTripSources() throws Exception {
        File asciiFile = getTestFile("ascii.txt");
        ByteSource byteSource = Files.asByteSource(asciiFile);
        assertSame(byteSource, byteSource.asCharSource(Charsets.UTF_8).asByteSource(Charsets.UTF_8));
      }
    
      public void testToByteArray() throws IOException {
        File asciiFile = getTestFile("ascii.txt");
        File i18nFile = getTestFile("i18n.txt");
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 22.2K bytes
    - Viewed (0)
Back to top