Examples of FastBufferOutputStream


Examples of org.ajax4jsf.io.FastBufferOutputStream

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

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

Examples of org.ajax4jsf.io.FastBufferOutputStream

  /**
   * Test method for {@link org.ajax4jsf.io.FastBufferOutputStream#reset()}.
   */
  public void testResetOneBuffer() throws Exception {
    FastBufferOutputStream stream = new FastBufferOutputStream(256);
    for (int i = 0; i < 255; i++) {
      stream.write(i);
    }
   
    assertEquals(255, stream.getLength());
    ByteBuffer firstBuffer = stream.getFirstBuffer();
    assertNull(firstBuffer.getNext());
    assertNull(firstBuffer.getPrevious());

    stream.reset();
   
    assertEquals(0, stream.getLength());
    firstBuffer = stream.getFirstBuffer();
    assertEquals(0, firstBuffer.getUsedSize());
    assertNull(firstBuffer.getNext());
    assertNull(firstBuffer.getPrevious());
  }
View Full Code Here

Examples of org.ajax4jsf.io.FastBufferOutputStream

 
  /**
   * Test method for {@link org.ajax4jsf.io.FastBufferOutputStream#reset()}.
   */
  public void testResetTwoBuffers() throws Exception {
    FastBufferOutputStream stream = new FastBufferOutputStream(256);
    for (int i = 0; i < 257; i++) {
      stream.write(i);
    }

    assertEquals(257, stream.getLength());
    ByteBuffer firstBuffer = stream.getFirstBuffer();
    assertNotNull(firstBuffer.getNext());
    assertNull(firstBuffer.getPrevious());

    stream.reset();
   
    assertEquals(0, stream.getLength());
    firstBuffer = stream.getFirstBuffer();
    assertEquals(0, firstBuffer.getUsedSize());
    assertNull(firstBuffer.getNext());
    assertNull(firstBuffer.getPrevious());
  }
View Full Code Here

Examples of org.ajax4jsf.io.FastBufferOutputStream

  public ServletOutputStream getOutputStream() throws IOException {
    if(useWriter){
      throw new IllegalStateException();
    }
    if (!useStream) {
      _bytes = new FastBufferOutputStream(getBufferSize());
      _servletStream = new ServletOutputStream(){

        /* (non-Javadoc)
         * @see java.io.OutputStream#flush()
         */
 
View Full Code Here

Examples of org.ajax4jsf.io.FastBufferOutputStream

 
  public void flushBuffer() throws IOException {
    if (useStream) {
      // TODO - detect encoding ?
      _bytes.writeTo(_jspWriter, getCharacterEncoding());
      _bytes = new FastBufferOutputStream(getBufferSize());
    }
  }
View Full Code Here

Examples of org.ajax4jsf.io.FastBufferOutputStream

      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

Examples of org.ajax4jsf.io.FastBufferOutputStream

      }
    }


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

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

Examples of org.ajax4jsf.io.FastBufferOutputStream

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

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

Examples of org.jboss.portletbridge.io.FastBufferOutputStream

   * @throws IOException
   * @see javax.portlet.RenderResponse#getPortletOutputStream()
   */
  public OutputStream getPortletOutputStream() throws IOException {
    if (fastBufferStream == null) {
      fastBufferStream = new FastBufferOutputStream();
    }

    return fastBufferStream;
  }
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.