java.io.ByteArrayOutputStream that:
org.springframework.util.ResizableByteArrayOutputStream#grow(int)
and org.springframework.util.ResizableByteArrayOutputStream#resize(int) methods
to get more control over the size of the internal bufferAs of 4.2, this class has been superseded by FastByteArrayOutputStream
for Spring's internal use where no assignability to ByteArrayOutputStream
is needed (since FastByteArrayOutputStream is more efficient with buffer
resize management but doesn't extend the standard ByteArrayOutputStream).
resize, FastByteArrayOutputStream
| Modifier and Type | Field and Description |
|---|---|
| private static final int |
| Access | Constructor and Description |
|---|---|
| public | ResizableByteArrayOutputStream()
Create a new |
| public | ResizableByteArrayOutputStream(int
the initial buffer size in bytes initialCapacity)Create a new |
| Modifier and Type | Method and Description |
|---|---|
| public synchronized int | |
| public synchronized void | grow(int
the number of bytes to add to the current buffer size additionalCapacity)Grow the internal buffer size. |
| public synchronized void | resize(int
the desired size of the buffer targetCapacity)Resize the internal buffer size to a specified capacity. |
| DEFAULT_INITIAL_CAPACITY | back to summary |
|---|---|
| private static final int DEFAULT_INITIAL_CAPACITY | |
| ResizableByteArrayOutputStream | back to summary |
|---|---|
| public ResizableByteArrayOutputStream() Create a new | |
| ResizableByteArrayOutputStream | back to summary |
|---|---|
| public ResizableByteArrayOutputStream(int initialCapacity) Create a new
| |
| capacity | back to summary |
|---|---|
| public synchronized int capacity() Return the current size of this stream's internal buffer. | |
| grow | back to summary |
|---|---|
| public synchronized void grow(int additionalCapacity) Grow the internal buffer size.
| |
| resize | back to summary |
|---|---|
| public synchronized void resize(int targetCapacity) Resize the internal buffer size to a specified capacity.
| |