Examples of asCharSource()


Examples of com.google.common.io.ByteSource.asCharSource()

   *
   */
  private void setupImportsExports(Package pkg, Namespace namespace) throws IOException {

    ByteSource namespaceFile = pkg.getResource("NAMESPACE");
    NamespaceDirectiveParser.parse(namespaceFile.asCharSource(Charsets.UTF_8),
        new NamespaceInitHandler(context, this, namespace));
  }


  public boolean isRegistered(Symbol name) {
View Full Code Here

Examples of com.google.common.io.ByteSource.asCharSource()

     
      LoginCredentials creds = LoginCredentials.builder().user("myuser").password("mypass").authenticateSudo(true).build();
      ByteSource bytes = toBytesFunc.apply(creds);
      LoginCredentials deserializedCreds = (LoginCredentials) fromBytesFunc.apply(bytes);
     
      String json = bytes.asCharSource(Charsets.UTF_8).read();
      assertEquals(json, "{\"user\":\"myuser\",\"password\":\"mypass\",\"authenticateSudo\":true}");
     
      assertEquals(deserializedCreds.identity, creds.identity);
      assertEquals(deserializedCreds.credential, creds.credential);
      assertEquals(deserializedCreds.getUser(), creds.getUser());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.