Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 18 for asCharSource (0.23 sec)

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

        checkNotNull(factory);
        return new CharSourceFactory() {
          @Override
          public CharSource createSource(String string) throws IOException {
            return factory.createSource(string.getBytes(Charsets.UTF_8)).asCharSource(Charsets.UTF_8);
          }
    
          @Override
          public String getExpected(String data) {
            return new String(factory.getExpected(data.getBytes(Charsets.UTF_8)), 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)
  2. android/guava/src/com/google/common/io/Files.java

       * @throws IOException if an I/O error occurs
       * @deprecated Prefer {@code asCharSource(file, charset).read()}.
       */
      @Deprecated
      @InlineMe(
          replacement = "Files.asCharSource(file, charset).read()",
          imports = "com.google.common.io.Files")
      public static String toString(File file, Charset charset) throws IOException {
        return asCharSource(file, charset).read();
      }
    
      /**
    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)
  3. android/guava/src/com/google/common/io/Resources.java

        }
      }
    
      /**
       * 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);
      }
    
      /**
       * Reads all bytes from a URL into a byte array.
       *
       * @param url the URL to read from
       * @return a byte array containing all the bytes from the URL
    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)
  4. guava-tests/test/com/google/common/io/SourceSinkFactories.java

        checkNotNull(factory);
        return new CharSourceFactory() {
          @Override
          public CharSource createSource(String string) throws IOException {
            return factory.createSource(string.getBytes(Charsets.UTF_8)).asCharSource(Charsets.UTF_8);
          }
    
          @Override
          public String getExpected(String data) {
            return new String(factory.getExpected(data.getBytes(Charsets.UTF_8)), Charsets.UTF_8);
          }
    
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Thu Sep 09 17:57:59 GMT 2021
    - 17.9K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/io/ByteSource.java

       * returned, rather than round-trip encoding. Subclasses that override this method should behave
       * the same way.
       */
      public CharSource asCharSource(Charset charset) {
        return new AsCharSource(charset);
      }
    
      /**
       * Opens a new {@link InputStream} for reading from this source. This method returns a new,
       * independent stream each time it is called.
       *
    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)
  6. android/guava/src/com/google/common/io/CharSource.java

        AsByteSource(Charset charset) {
          this.charset = checkNotNull(charset);
        }
    
        @Override
        public CharSource asCharSource(Charset charset) {
          if (charset.equals(this.charset)) {
            return CharSource.this;
          }
          return super.asCharSource(charset);
        }
    
        @Override
        public InputStream openStream() throws IOException {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed May 17 14:35:11 GMT 2023
    - 22.4K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/io/ByteSourceTest.java

      public static TestSuite suite() {
        TestSuite suite = new TestSuite();
        for (boolean asCharSource : new boolean[] {false, true}) {
          suite.addTest(
              ByteSourceTester.tests(
                  "ByteSource.wrap[byte[]]",
                  SourceSinkFactories.byteArraySourceFactory(),
                  asCharSource));
          suite.addTest(
              ByteSourceTester.tests(
    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. android/guava-tests/test/com/google/common/io/ByteSourceTester.java

        CharSourceFactory charSourceFactory = SourceSinkFactories.asCharSourceFactory(factory);
        suite.addTest(
            CharSourceTester.suiteForString(
                charSourceFactory, string, name + ".asCharSource[Charset]", desc));
        return suite;
      }
    
      static TestSuite suiteForBytes(
          ByteSourceFactory factory, byte[] bytes, String name, String desc, boolean slice) {
    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)
  9. guava-tests/test/com/google/common/io/ByteSourceTest.java

      public static TestSuite suite() {
        TestSuite suite = new TestSuite();
        for (boolean asCharSource : new boolean[] {false, true}) {
          suite.addTest(
              ByteSourceTester.tests(
                  "ByteSource.wrap[byte[]]",
                  SourceSinkFactories.byteArraySourceFactory(),
                  asCharSource));
          suite.addTest(
              ByteSourceTester.tests(
    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)
  10. guava-tests/benchmark/com/google/common/io/ByteSourceAsCharSourceReadBenchmark.java

    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.nio.charset.Charset;
    import java.util.Random;
    
    /**
     * Benchmarks for various potential implementations of {@code ByteSource.asCharSource(...).read()}.
     */
    // These benchmarks allocate a lot of data so use a large heap
    @VmOptions({"-Xms12g", "-Xmx12g", "-d64"})
    public class ByteSourceAsCharSourceReadBenchmark {
      enum ReadStrategy {
    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)
Back to top