Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 24 for asByteSource (0.08 sec)

  1. 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)
  2. 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
    - 17.7K bytes
    - Viewed (0)
  3. 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(
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Oct 31 14:20:11 UTC 2024
    - 11.4K bytes
    - Viewed (0)
  4. android/guava-tests/test/com/google/common/io/SourceSinkFactory.java

     *
     * <p>A single {@code SourceSinkFactory} implementation generally corresponds to one specific way of
     * creating a source or sink, such as {@link Files#asByteSource(File)}. Implementations of {@code
     * SourceSinkFactory} for common.io are found in {@link SourceSinkFactories}.
     *
     * @param <S> the source or sink type
     * @param <T> the data type (byte[] or String)
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Dec 04 17:37:03 UTC 2017
    - 3K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/io/CharSourceTester.java

        ByteSourceFactory byteSourceFactory = SourceSinkFactories.asByteSourceFactory(factory);
        suite.addTest(
            ByteSourceTester.suiteForBytes(
                byteSourceFactory, bytes, name + ".asByteSource[Charset]", desc, slice));
        return suite;
      }
    
      static TestSuite suiteForString(
          CharSourceFactory factory, String string, String name, String desc) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Jul 23 14:22:54 UTC 2024
    - 7.3K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/io/ByteSource.java

        AsCharSource(Charset charset) {
          this.charset = checkNotNull(charset);
        }
    
        @Override
        public ByteSource asByteSource(Charset charset) {
          if (charset.equals(this.charset)) {
            return ByteSource.this;
          }
          return super.asByteSource(charset);
        }
    
        @Override
        public Reader openStream() throws IOException {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:26:48 UTC 2024
    - 26.2K bytes
    - Viewed (0)
  7. 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)
  8. android/guava/src/com/google/common/io/MoreFiles.java

         * entities such as devices or pipes, in which case we must fall back on comparing the bytes
         * directly.
         */
        ByteSource source1 = asByteSource(path1);
        ByteSource source2 = asByteSource(path2);
        long len1 = source1.sizeIfKnown().or(0L);
        long len2 = source2.sizeIfKnown().or(0L);
        if (len1 != 0 && len2 != 0 && len1 != len2) {
          return false;
        }
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Oct 31 16:07:00 UTC 2024
    - 35K bytes
    - Viewed (0)
  9. guava/src/com/google/common/io/MoreFiles.java

         * entities such as devices or pipes, in which case we must fall back on comparing the bytes
         * directly.
         */
        ByteSource source1 = asByteSource(path1);
        ByteSource source2 = asByteSource(path2);
        long len1 = source1.sizeIfKnown().or(0L);
        long len2 = source2.sizeIfKnown().or(0L);
        if (len1 != 0 && len2 != 0 && len1 != len2) {
          return false;
        }
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Oct 31 16:07:00 UTC 2024
    - 34.5K bytes
    - Viewed (0)
  10. 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)
Back to top