Package juzu.io

Examples of juzu.io.OutputStream


    return key.toString();
  }

  public StringBuilder render() throws IOException {
    StringBuilder buffer = new StringBuilder();
    OutputStream consumer = OutputStream.create(Tools.UTF_8, buffer);
    render(consumer);
    return buffer;
  }
View Full Code Here


        return locale;
      }
    }

    private void doRender(PropertyMap properties, Appendable appendable) throws UndeclaredIOException {
      OutputStream out = OutputStream.create(Tools.UTF_8, appendable);
      doRender(properties, out);
      final AtomicReference<IOException> ios = new AtomicReference<IOException>();
      out.close(new Thread.UncaughtExceptionHandler() {
        public void uncaughtException(Thread t, Throwable e) {
          if (e instanceof IOException) {
            ios.set((IOException)e);
          }
        }
View Full Code Here

  }

  public void render(String text, Map<String, Object> attributes, Locale locale, Appendable appendable) throws IOException, TemplateExecutionException, TemplateException {
    GroovyTemplateStub template = template(text);
    TemplateRenderContext renderContext = new TemplateRenderContext(template, null, attributes, locale);
    OutputStream adapter = OutputStream.create(Tools.UTF_8, appendable);
    renderContext.render(adapter);
    final AtomicReference<IOException> ios = new AtomicReference<IOException>();
    adapter.close(new Thread.UncaughtExceptionHandler() {
      public void uncaughtException(Thread t, Throwable e) {
        if (e instanceof IOException) {
          ios.set((IOException)e);
        }
      }
View Full Code Here

TOP

Related Classes of juzu.io.OutputStream

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.