Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 22 for AsByteSource (0.12 sec)

  1. android/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();
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Oct 31 16:07:00 UTC 2024
    - 26.5K bytes
    - Viewed (0)
  2. 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, UTF_8)).asByteSource(UTF_8);
          }
    
          @Override
          public byte[] getExpected(byte[] data) {
            return factory.getExpected(new String(data, UTF_8)).getBytes(UTF_8);
          }
    
          @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)
  3. android/guava-tests/test/com/google/common/io/ResourcesTest.java

      public static TestSuite suite() {
        TestSuite suite = new TestSuite();
        suite.addTest(
            ByteSourceTester.tests(
                "Resources.asByteSource[URL]", SourceSinkFactories.urlByteSourceFactory(), true));
        suite.addTest(
            CharSourceTester.tests(
                "Resources.asCharSource[URL, Charset]",
                SourceSinkFactories.urlCharSourceFactory(),
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Jul 23 14:22:54 UTC 2024
    - 6.8K bytes
    - Viewed (0)
  4. 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);
      }
    
      /**
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Jul 22 19:03:12 UTC 2024
    - 33.1K bytes
    - Viewed (0)
  5. 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(UTF_8).asByteSource(UTF_8));
      }
    
      public void testToByteArray() throws IOException {
        File asciiFile = getTestFile("ascii.txt");
        File i18nFile = getTestFile("i18n.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)
  6. android/guava-tests/test/com/google/common/reflect/ClassPathTest.java

          System.setProperty(JAVA_CLASS_PATH.key(), oldClassPath);
        }
      }
    
      private static boolean contentEquals(URL left, URL right) throws IOException {
        return Resources.asByteSource(left).contentEquals(Resources.asByteSource(right));
      }
    
      private static class Nested {}
    
    
      public void testNulls() throws IOException {
        new NullPointerTester().testAllPublicStaticMethods(ClassPath.class);
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Jul 24 22:09:38 UTC 2024
    - 25K bytes
    - Viewed (0)
  7. 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 = min(dataSize, fileThreshold);
        int chunk2 = dataSize - chunk1;
    
        // Write just enough to not trip the threshold
        if (chunk1 > 0) {
          write(out, data, 0, chunk1, singleByte);
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:26:48 UTC 2024
    - 5.5K bytes
    - Viewed (0)
  8. 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);
      }
    
      /**
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Aug 02 13:50:22 UTC 2024
    - 7.5K 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(UTF_8).asByteSource(UTF_8));
      }
    
      public void testToByteArray() throws IOException {
        File asciiFile = getTestFile("ascii.txt");
        File i18nFile = getTestFile("i18n.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)
  10. 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();
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Oct 17 02:42:09 UTC 2024
    - 27.4K bytes
    - Viewed (0)
Back to top