Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for asCharSource (0.17 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(UTF_8)).asCharSource(UTF_8);
          }
    
          @Override
          public String getExpected(String data) {
            return new String(factory.getExpected(data.getBytes(UTF_8)), 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)
  2. 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(
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:26:48 UTC 2024
    - 15.4K bytes
    - Viewed (0)
  3. 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(UTF_8)).asCharSource(UTF_8);
          }
    
          @Override
          public String getExpected(String data) {
            return new String(factory.getExpected(data.getBytes(UTF_8)), 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)
  4. 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 {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Oct 31 14:20:11 UTC 2024
    - 25.5K 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.
       *
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:26:48 UTC 2024
    - 26.2K bytes
    - Viewed (0)
  6. 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(
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:26:48 UTC 2024
    - 15.4K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/io/MoreFiles.java

       * equivalent to providing the {@link StandardOpenOption#READ READ} option.
       */
      public static CharSource asCharSource(Path path, Charset charset, OpenOption... options) {
        return asByteSource(path, options).asCharSource(charset);
      }
    
      /**
       * Returns a view of the given {@code path} as a {@link CharSink} using the given {@code charset}.
       *
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Oct 31 16:07:00 UTC 2024
    - 35K bytes
    - Viewed (0)
  8. guava/src/com/google/common/io/MoreFiles.java

            // like following/not following symlinks.)
            return new AsCharSource(charset) {
              @SuppressWarnings("FilesLinesLeak") // the user needs to close it in this case
              @Override
              public Stream<String> lines() throws IOException {
                return Files.lines(path, charset);
              }
            };
          }
    
          return super.asCharSource(charset);
        }
    
        @Override
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Oct 31 16:07:00 UTC 2024
    - 34.5K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/io/MoreFilesTest.java

            ByteSinkTester.tests(
                "MoreFiles.asByteSink[Path, APPEND]",
                SourceSinkFactories.appendingPathByteSinkFactory()));
        suite.addTest(
            CharSourceTester.tests(
                "MoreFiles.asCharSource[Path, Charset]",
                SourceSinkFactories.pathCharSourceFactory(),
                false));
        suite.addTest(
            CharSinkTester.tests(
    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