public class BoundedByteArrayOutputStream extends OutputStream
reset
API and choose different limits in each round.| Constructor and Description |
|---|
BoundedByteArrayOutputStream(int capacity)
Create a BoundedByteArrayOutputStream with the specified
capacity
|
BoundedByteArrayOutputStream(int capacity,
int limit)
Create a BoundedByteArrayOutputStream with the specified
capacity and limit.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getBuffer()
Returns the underlying buffer.
|
int |
getLimit()
Return the current limit
|
void |
reset()
Reset the buffer
|
void |
reset(int newlim)
Reset the limit
|
int |
size()
Returns the length of the valid data
currently in the buffer.
|
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
close, flush, writepublic BoundedByteArrayOutputStream(int capacity)
capacity - The capacity of the underlying byte arraypublic BoundedByteArrayOutputStream(int capacity,
int limit)
capacity - The capacity of the underlying byte arraylimit - The maximum limit upto which data can be writtenpublic void write(int b)
throws IOException
write in class OutputStreamIOExceptionpublic void write(byte[] b,
int off,
int len)
throws IOException
write in class OutputStreamIOExceptionpublic void reset(int newlim)
newlim - New Limitpublic void reset()
public int getLimit()
public byte[] getBuffer()
size().public int size()
Copyright © 2007-2012 The Apache Software Foundation