Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.ajax4jsf.io
Class FastBufferOutputStream

    java.lang.Object
      java.io.OutputStream
          org.ajax4jsf.io.FastBufferOutputStream

All Implemented Interfaces:
  java.io.Closeable, java.io.Flushable

    public class FastBufferOutputStream

extends java.io.OutputStream

Class for writing to chain of byte arrays extending OutputStream.

Author:
  glory

Constructor Summary
`FastBufferOutputStream()` Creates instance of default initial capacity.
`FastBufferOutputStream(ByteBuffer firstBuffer)` Creates instance for an already existing chain of byte arrays.
`FastBufferOutputStream(int initialSize)` Creates instance with required initial capacity.

Method Summary
`FastBufferWriter` | `convertToWriter()` Returns instance of FastBufferWriter containing all data written to this output stream.
`FastBufferWriter` | `convertToWriter(java.lang.String encoding)` Returns instance of FastBufferWriter containing all data written to this output stream.
`ByteBuffer` | `getFirstBuffer()` Returns the first link of the chain of byte arrays.
`int` | `getLength()` Returns the total number of written bytes.
`void` | `reset()` Resets stream to empty state
`byte[]` | `toByteArray()`
`void` | `write(byte[] b)`
`void` | `write(byte[] b, int off, int len)`
`void` | `write(int c)`
`void` | `writeTo(java.io.OutputStream out)` Writes all data written up to the moment to out.
`void` | `writeTo(java.io.Writer out, java.lang.String encoding)` Writes all data written up to the moment to out.

Methods inherited from class java.io.OutputStream
`close, flush`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### FastBufferOutputStream

    public FastBufferOutputStream()

  Creates instance of default initial capacity.

### FastBufferOutputStream

    public FastBufferOutputStream(ByteBuffer firstBuffer)

  Creates instance for an already existing chain of byte arrays.

  Parameters:
    `firstBuffer` -

### FastBufferOutputStream

    public FastBufferOutputStream(int initialSize)

  Creates instance with required initial capacity.

  Parameters:
    `initialSize` -

Method Detail

### write

    public void write(int c)
               throws java.io.IOException

  Specified by:
    `write` in class `java.io.OutputStream`
  Throws:
    `java.io.IOException`
  See Also:
    `java.io.OutputStream.write(int c)`

### write

    public void write(byte[] b)
               throws java.io.IOException

  Overrides:
    `write` in class `java.io.OutputStream`
  Throws:
    `java.io.IOException`
  See Also:
    `java.io.OutputStream.write(byte b[])`

### write

    public void write(byte[] b,
                      int off,
                      int len)
               throws java.io.IOException

  Overrides:
    `write` in class `java.io.OutputStream`
  Throws:
    `java.io.IOException`
  See Also:
    `java.io.OutputStream.write(byte[] b, int off, int len)`

### getLength

    public int getLength()

  Returns the total number of written bytes.

  Returns:

### getFirstBuffer

    public ByteBuffer getFirstBuffer()

  Returns the first link of the chain of byte arrays.

  Returns:

### toByteArray

    public byte[] toByteArray()

### writeTo

    public void writeTo(java.io.OutputStream out)
                 throws java.io.IOException

  Writes all data written up to the moment to out.

  Parameters:
    `out` -
  Throws:
    `java.io.IOException`

### writeTo

    public void writeTo(java.io.Writer out,
                        java.lang.String encoding)
                 throws java.io.IOException

  Writes all data written up to the moment to out.

  Parameters:
    `out` -
  Throws:
    `java.io.IOException`

### convertToWriter

    public FastBufferWriter convertToWriter(java.lang.String encoding)
                                     throws java.io.UnsupportedEncodingException

  Returns instance of FastBufferWriter containing all data written to this output stream.

  Parameters:
    `encoding` -
  Returns:
  Throws:
    `java.io.UnsupportedEncodingException`

### convertToWriter

    public FastBufferWriter convertToWriter()

  Returns instance of FastBufferWriter containing all data written to this output stream.

  Returns:

### reset

    public void reset()

  Resets stream to empty state

  Since:
    3.3.0

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2010 JBoss, a division of Red Hat, Inc.. All Rights Reserved.