Package com.google.common.io.SourceSinkFactory

Examples of com.google.common.io.SourceSinkFactory.CharSourceFactory


    return new UrlCharSourceFactory();
  }

  public static CharSourceFactory asCharSourceFactory(final ByteSourceFactory factory) {
    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);
      }
View Full Code Here


  }

  private static TestSuite suiteForString(ByteSourceFactory factory, String string,
      String name, String desc) {
    TestSuite suite = suiteForBytes(factory, string.getBytes(Charsets.UTF_8), name, desc, true);
    CharSourceFactory charSourceFactory = SourceSinkFactories.asCharSourceFactory(factory);
    suite.addTest(CharSourceTester.suiteForString(charSourceFactory, string,
        name + ".asCharSource[Charset]", desc));
    return suite;
  }
View Full Code Here

TOP

Related Classes of com.google.common.io.SourceSinkFactory.CharSourceFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.