public class LimitedByteArrayOutputStream
extends java.io.OutputStream
Modifier and Type | Class and Description |
---|---|
static class |
LimitedByteArrayOutputStream.LimitExceededException |
Constructor and Description |
---|
LimitedByteArrayOutputStream(int max,
int initial)
Constructs a LimitedByteArrayOutputStream, which stores output in memory up to a certain
specified size.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
toByteArray() |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
public LimitedByteArrayOutputStream(int max, int initial)
max
- the maximum size in bytes which may be stored.initial
- the initial size. It must be smaller than the max size.public void write(int b) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(byte[] b, int off, int len) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public byte[] toByteArray()