Package org.ajax4jsf.io

Examples of org.ajax4jsf.io.FastBufferWriter


        for (int i = 0; i < 10; i++) {
            s = s + s; // repeated 16 times
        }

        char[] bytes = s.toCharArray();
        FastBufferWriter output = new FastBufferWriter(16);

        // write it several times.
        for (int i = 0; i < 4; i++) {
            output.write(bytes);
        }

        // write it one more time by one byte
        for (int i = 0; i < bytes.length; i++) {
            output.write(bytes[i]);
        }

        FastBufferReader input = new FastBufferReader(output);
        StringBuffer sb = new StringBuffer();
View Full Code Here


        for (int i = 0; i < 10; i++) {
            s = s + s; // repeated 16 times
        }

        char[] bytes = s.toCharArray();
        FastBufferWriter output = new FastBufferWriter(16);

        // write it several times.
        for (int i = 0; i < 4; i++) {
            output.write(bytes);
        }

        // write it one more time by one byte
        for (int i = 0; i < bytes.length; i++) {
            output.write(bytes[i]);
        }

        FastBufferOutputStream output2 = output.convertToOutputStream("UTF-8");
        FastBufferInputStream input = new FastBufferInputStream(output2);
        StringBuffer sb = new StringBuffer();

        // use for reading unconvenient array length.
        byte[] bs = new byte[ARRAY_LENGTH];
View Full Code Here

        // write it one more time by one byte
        for (int i = 0; i < bytes.length; i++) {
            output.write(bytes[i]);
        }

        FastBufferWriter output2 = output.convertToWriter("UTF-8");
        FastBufferReader input = new FastBufferReader(output2);
        StringBuffer sb = new StringBuffer();

        // use for reading unconvenient array length.
        char[] bs = new char[ARRAY_LENGTH];
View Full Code Here

    return servletStream;
  }

  public PrintWriter getWriter() {
    if (null == servletWriter) {
      stringOutputWriter = new FastBufferWriter(1024);
      Writer out = new Writer() {

        public void write(char[] cbuf, int off, int len)
            throws IOException {
          stringOutputWriter.write(cbuf, off, len);
View Full Code Here

        servletOutputStream.flush();
      } catch (IOException ex) {
        log.warn(Messages.getMessage(Messages.FLUSH_BUFFERED_STREAM_ERROR), ex);
      }
      try {
        FastBufferWriter writer = byteStream.convertToWriter(encoding);
        result = new FastBufferReader(writer);
///        content = byteStream.toString(encoding);
      } catch (UnsupportedEncodingException e) {
        log.warn(Messages.getMessage(Messages.UNSUPPORTED_ENCODING_WARNING_2), e);
        FastBufferWriter writer = byteStream.convertToWriter();
        result = new FastBufferReader(writer);
///        content = byteStream.toString();
      }
        } else  {
            if (log.isDebugEnabled()) {
View Full Code Here

      private boolean opened = true;

      public ServletStringWriter() {
      super();
      stringWriter = new FastBufferWriter(bufferSize);
    }
View Full Code Here

            return;
        }

        if (null != out) {
          if(!(out instanceof FastBufferWriter)) {
            FastBufferWriter bout = new FastBufferWriter();
          pprint(((DOMDocumentImpl) doc).adaptee, OutFactory.getOut(
              this.configuration, bout));
          bout.writeTo(out);
          } else {
          pprint(((DOMDocumentImpl) doc).adaptee, OutFactory.getOut(
              this.configuration, out));
          }
    }
View Full Code Here

    return servletStream;
  }

  public PrintWriter getWriter() {
    if (null == servletWriter) {
      stringOutputWriter = new FastBufferWriter(1024);
      Writer out = new Writer() {

        public void write(char[] cbuf, int off, int len)
            throws IOException {
          stringOutputWriter.write(cbuf, off, len);
View Full Code Here

        servletOutputStream.flush();
      } catch (IOException ex) {
        log.warn(Messages.getMessage(Messages.FLUSH_BUFFERED_STREAM_ERROR), ex);
      }
      try {
        FastBufferWriter writer = byteStream.convertToWriter(encoding);
        result = new FastBufferReader(writer);
///        content = byteStream.toString(encoding);
      } catch (UnsupportedEncodingException e) {
        log.warn(Messages.getMessage(Messages.UNSUPPORTED_ENCODING_WARNING_2), e);
        FastBufferWriter writer = byteStream.convertToWriter();
        result = new FastBufferReader(writer);
///        content = byteStream.toString();
      }
        } else  {
            if (log.isDebugEnabled()) {
View Full Code Here

      private boolean opened = true;

      public ServletStringWriter() {
      super();
      stringWriter = new FastBufferWriter(bufferSize);
    }
View Full Code Here

TOP

Related Classes of org.ajax4jsf.io.FastBufferWriter

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.