OutputStream implementation to write to a Buffer.
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private CompositeBuffer | |
| private Buffer | |
| pack-priv final MemoryManager | |
| pack-priv final boolean |
| Access | Constructor and Description |
|---|---|
| public | BufferOutputStream(final MemoryManager<E extends Buffer> mm)
Creates the BufferOutputStream without initial Buffer. |
| public | BufferOutputStream(final MemoryManager<E extends Buffer> mm, final Buffer
initial buffer)BufferCreates the BufferOutputStream using passed |
| public | BufferOutputStream(final MemoryManager<E extends Buffer> mm, final Buffer
initial buffer, final boolean reallocate)BufferCreates the BufferOutputStream using passed |
| Modifier and Type | Method and Description |
|---|---|
| protected Buffer | |
| public void | close()
Overrides java. Implements java. Closes this output stream and releases any system resources associated with this stream. |
| private void | |
| public void | flush()
Overrides java. Implements java. Flushes this output stream and forces any buffered output bytes to be written out. |
| private void | |
| public Buffer | |
| public boolean | Returns: true if "reallocate" strategy is used or false otherwise.Returns true if "reallocate" strategy is used or false otherwise. |
| public void | |
| public void | |
| public void | write(int b)
Implements abstract java. Writes the specified byte to this output stream. |
| public void | write(byte[] b)
Overrides java. Writes |
| public void | write(byte[] b, int off, int len)
Overrides java. Writes |
| BUFFER_SIZE | back to summary |
|---|---|
| private static final int BUFFER_SIZE | |
| compositeBuffer | back to summary |
|---|---|
| private CompositeBuffer compositeBuffer | |
| currentBuffer | back to summary |
|---|---|
| private Buffer currentBuffer | |
| mm | back to summary |
|---|---|
| pack-priv final MemoryManager<E extends Buffer> mm | |
| reallocate | back to summary |
|---|---|
| pack-priv final boolean reallocate | |
| BufferOutputStream | back to summary |
|---|---|
| public BufferOutputStream(final MemoryManager<E extends Buffer> mm) Creates the BufferOutputStream without initial Buffer. Created BufferOutputStream won't use "reallocate"
strategy, which means if internal
| |
| BufferOutputStream | back to summary |
|---|---|
| public BufferOutputStream(final MemoryManager<E extends Buffer> mm, final Buffer buffer) Creates the BufferOutputStream using passed
| |
| BufferOutputStream | back to summary |
|---|---|
| public BufferOutputStream(final MemoryManager<E extends Buffer> mm, final Buffer buffer, final boolean reallocate) Creates the BufferOutputStream using passed
| |
| allocateNewBuffer | back to summary |
|---|---|
| protected Buffer allocateNewBuffer(final MemoryManager<E extends Buffer> memoryManager, final int size) | |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides java. Implements java. Doc from java. Closes this output stream and releases any system resources
associated with this stream. The general contract of
| |
| ensureCapacity | back to summary |
|---|---|
private void ensureCapacity(final int len)
| |
| flush | back to summary |
|---|---|
| public void flush() throws IOException Overrides java. Implements java. Doc from java. Flushes this output stream and forces any buffered output bytes
to be written out. The general contract of If the intended destination of this stream is an abstraction provided by the underlying operating system, for example a file, then flushing the stream guarantees only that bytes previously written to the stream are passed to the operating system for writing; it does not guarantee that they are actually written to a physical device such as a disk drive.
| |
| flushCurrent | back to summary |
|---|---|
| private void flushCurrent() | |
| getBuffer | back to summary |
|---|---|
| public Buffer getBuffer() Get the result | |
| isReallocate | back to summary |
|---|---|
| public boolean isReallocate() Returns true if "reallocate" strategy is used or false otherwise. Using "reallocate" strategy means
following: if internal
| |
| reset | back to summary |
|---|---|
| public void reset() | |
| setInitialOutputBuffer | back to summary |
|---|---|
| public void setInitialOutputBuffer(final Buffer initialBuffer) | |
| write | back to summary |
|---|---|
| public void write(int b) throws IOException Implements abstract java. Doc from java. Writes the specified byte to this output stream. The general
contract for
| |
| write | back to summary |
|---|---|
| public void write(byte[] b) throws IOException Overrides java. Doc from java. Writes
| |
| write | back to summary |
|---|---|
| public void write(byte[] b, int off, int len) throws IOException Overrides java. Doc from java. Writes
If
If
| |