FileDocCategorySizeDatePackage
DirectByteArrayOutputStream.javaAPI DocApache Tomcat 6.0.141957Fri Jul 20 04:20:34 BST 2007org.apache.catalina.tribes.io

DirectByteArrayOutputStream

public class DirectByteArrayOutputStream extends OutputStream
Byte array output stream that exposes the byte array directly
author
not attributable
version
1.0

Fields Summary
private XByteBuffer
buffer
Constructors Summary
public DirectByteArrayOutputStream(int size)

        buffer = new XByteBuffer(size,false);
    
Methods Summary
public byte[]getArray()

        return buffer.getBytes();
    
public byte[]getArrayDirect()

        return buffer.getBytesDirect();
    
public intsize()

        return buffer.getLength();
    
public voidwrite(int b)
Writes the specified byte to this output stream.

param
b the byte.
throws
IOException if an I/O error occurs. In particular, an IOException may be thrown if the output stream has been closed.
todo
Implement this java.io.OutputStream method

        buffer.append((byte)b);