Package org.ajax4jsf.io

Examples of org.ajax4jsf.io.FastBufferOutputStream


            // @todo should we inform users than tidy can't print a generic Node or change the method signature?
            return;
        }
        if (null != out) {
          if(!(out instanceof FastBufferOutputStream)) {
            FastBufferOutputStream bout = new FastBufferOutputStream();
          pprint(((DOMNodeImpl) node).adaptee, OutFactory.getOut(
              this.configuration, bout));
          bout.writeTo(out);
          } else {
          pprint(((DOMNodeImpl) node).adaptee, OutFactory.getOut(
              this.configuration, out));
          }
    }
View Full Code Here


   * @param responseStream
   * @return
   */
  public OutputStream getOutputStream() {
    if (null == servletStream) {
      outputStream = new FastBufferOutputStream(1024);
      servletStream = new ServletOutputStream() {

        /*
         * (non-Javadoc)
         *
 
View Full Code Here

      printWriter.flush();
      printWriter.close();
      length = stringWriter.getLength();
///      String stringContent = stringWriter.toString();
      try {
        FastBufferOutputStream stream = stringWriter.convertToOutputStream(encoding);
        result = new FastBufferInputStream(stream);
///        content = stringContent.getBytes(encoding);
      } catch (UnsupportedEncodingException e) {
        // TODO Auto-generated catch block
        log.warn(Messages.getMessage(Messages.UNSUPPORTED_ENCODING_WARNING));
        FastBufferOutputStream stream = stringWriter.convertToOutputStream();
        result = new FastBufferInputStream(stream);
///        content = stringContent.getBytes();
      }
    } else  {
            if (log.isDebugEnabled()) {
View Full Code Here

      }
    }


    public ByteArrayServletOutputStream() {
            byteStream = new FastBufferOutputStream(bufferSize);
        }
View Full Code Here

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

        byte[] bytes = s.getBytes();
        FastBufferOutputStream output = new FastBufferOutputStream(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]);
        }

        FastBufferInputStream input = new FastBufferInputStream(output);
        StringBuffer sb = new StringBuffer();

        // use for reading unconvenient array length.
        byte[] bs = new byte[ARRAY_LENGTH];
        int l = 0;

        while ((l = input.read(bs, READ_OFF, READ_LENGTH)) >= 0) {
            if (BUILD_STRING) {
                sb.append(new String(bs, READ_OFF, l));
            }
        }

        if (BUILD_STRING && OUT_STRING) {
            System.out.println(sb);
            System.out.println("Length=" + output.getLength());
        }
    }
View Full Code Here

        // 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

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

        byte[] bytes = s.getBytes();
        FastBufferOutputStream output = new FastBufferOutputStream(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]);
        }

        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

            // @todo should we inform users than tidy can't print a generic Node or change the method signature?
            return;
        }
        if (null != out) {
          if(!(out instanceof FastBufferOutputStream)) {
            FastBufferOutputStream bout = new FastBufferOutputStream();
          pprint(((DOMNodeImpl) node).adaptee, OutFactory.getOut(
              this.configuration, bout));
          bout.writeTo(out);
          } else {
          pprint(((DOMNodeImpl) node).adaptee, OutFactory.getOut(
              this.configuration, out));
          }
    }
View Full Code Here

      printWriter.flush();
      printWriter.close();
      length = stringWriter.getLength();
///      String stringContent = stringWriter.toString();
      try {
        FastBufferOutputStream stream = stringWriter.convertToOutputStream(encoding);
        result = new FastBufferInputStream(stream);
///        content = stringContent.getBytes(encoding);
      } catch (UnsupportedEncodingException e) {
        // TODO Auto-generated catch block
        log.warn(Messages.getMessage(Messages.UNSUPPORTED_ENCODING_WARNING));
        FastBufferOutputStream stream = stringWriter.convertToOutputStream();
        result = new FastBufferInputStream(stream);
///        content = stringContent.getBytes();
      }
    } else  {
            if (log.isDebugEnabled()) {
View Full Code Here

      }
    }


    public ByteArrayServletOutputStream() {
            byteStream = new FastBufferOutputStream(bufferSize);
        }
View Full Code Here

TOP

Related Classes of org.ajax4jsf.io.FastBufferOutputStream

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.