org.fusesource.hawtbuf
Class ByteArrayOutputStream
java.lang.Object
java.io.OutputStream
org.fusesource.hawtbuf.ByteArrayOutputStream
- All Implemented Interfaces:
- Closeable, Flushable
public class ByteArrayOutputStream
- extends OutputStream
Very similar to the java.io.ByteArrayOutputStream but this version
is not thread safe and the resulting data is returned in a Buffer
to avoid an extra byte[] allocation.
- Author:
- Hiram Chirino
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ByteArrayOutputStream
public ByteArrayOutputStream()
ByteArrayOutputStream
public ByteArrayOutputStream(int capacity)
write
public void write(int b)
- Specified by:
write
in class OutputStream
write
public void write(byte[] b,
int off,
int len)
- Overrides:
write
in class OutputStream
write
public void write(Buffer b)
reset
public void reset()
toBuffer
public Buffer toBuffer()
toByteArray
public byte[] toByteArray()
size
public int size()
Copyright © 2010-2014 FuseSource, Corp.. All Rights Reserved.