public class ReusableByteArrayOutputStream extends ByteArrayOutputStream
buf, count| Constructor and Description |
|---|
ReusableByteArrayOutputStream()
Creates a ByteArrayOutputStream by calling the super class's constructor.
|
ReusableByteArrayOutputStream(int size)
Creates a ByteArrayOutputStream by calling the super class's constructor.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getBuf()
Gets the underlying buffer.
|
int |
getCount()
Current count of the bytes in the buffer.
|
ByteArrayInputStream |
getInputStream()
Gets an Input Stream from which one can read the contents of the data written to the stream.
|
void |
reset(int maxBufSize)
Resets the stream and in addition limits the internal buffer's size to maxBufSize.
|
void |
setBuf(byte[] b)
Sets a new buffer and resets the stream.
|
void |
setCount(int pcount)
Sets the count value.
|
close, reset, size, toByteArray, toString, toString, toString, write, write, writeToflush, writepublic ReusableByteArrayOutputStream()
public ReusableByteArrayOutputStream(int size)
size - the initial size.IllegalArgumentException - if size is negative.public void reset(int maxBufSize)
maxBufSize - Max Buf Size after resetpublic ByteArrayInputStream getInputStream()
public int getCount()
public void setCount(int pcount)
pcount - public byte[] getBuf()
public void setBuf(byte[] b)
b - New buffer to useCopyright © 2013- Suresh Mahalingam. All Rights Reserved.