OutputStream wrapper that analyzes X Protocol frames and routes them directly to the original underlying OutputStream or passes them
through to a compressor-able OutputStream to compresses the frame, rebuilds it and then sends a newly compressed X Protocol frame, depending on
defined data size threshold.
| Modifier and Type | Field and Description |
|---|---|
| private ByteArrayOutputStream | |
| private boolean | |
| private boolean | |
| private CompressorStreamsFactory | |
| private OutputStream | |
| private byte[] | |
| private int | |
| private int | |
| private int | |
| private int | |
| private byte[] | |
| private XMessageHeader |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Overrides java. Implements java. Closes this stream. |
| private void | |
| private void | finalizeWrite()
Finalizes the writing of the compressed |
| private boolean | Returns: true if the frame header buffer is full, false otherwise.Checks if there is a complete frame header already buffered. |
| private boolean | Returns: true if the frame header was written, false otherwise.Checks if the entire frame X Protocol frame header has been fully written. |
| private boolean | Returns: true the payload can be written, false otherwise.Checks if the X Protocol frame payload is ready to be written on the underlying |
| private boolean | Returns: true if the frame currently in progress was fully written, false otherwise.Checks if current X Protocol frame has been fully written. |
| private int | Returns: the number of bytes actually buffered.the data. b, int the start offset in the data. off, int the number of bytes to write. len)Captures the first bytes of each X Protocol frame into a byte buffer. |
| public void | write(int
the b)byte.Overrides java. Forwards the write to |
| public void | write(byte[]
the data to be written. b)Overrides java. Forwards the write to |
| public void | write(byte[]
the data. b, int the start offset in the data. off, int the number of bytes to write. len)Overrides java. Analyzes the given bytes as an X Protocol frame and, depending on its size, writes it as-is in the underlying |
| bufferOut | back to summary |
|---|---|
| private ByteArrayOutputStream bufferOut | |
| closed | back to summary |
|---|---|
| private boolean closed | |
| compressionEnabled | back to summary |
|---|---|
| private boolean compressionEnabled | |
| compressorIoStreamsFactory | back to summary |
|---|---|
| private CompressorStreamsFactory compressorIoStreamsFactory | |
| compressorOut | back to summary |
|---|---|
| private OutputStream compressorOut | |
| frameHeader | back to summary |
|---|---|
| private byte[] frameHeader | |
| frameHeaderBuffered | back to summary |
|---|---|
| private int frameHeaderBuffered | |
| frameHeaderDumped | back to summary |
|---|---|
| private int frameHeaderDumped | |
| framePayloadDumped | back to summary |
|---|---|
| private int framePayloadDumped | |
| framePayloadLength | back to summary |
|---|---|
| private int framePayloadLength | |
| singleByte | back to summary |
|---|---|
| private byte[] singleByte | |
| xMessageHeader | back to summary |
|---|---|
| private XMessageHeader xMessageHeader | |
| CompressionSplittedOutputStream | back to summary |
|---|---|
| public CompressionSplittedOutputStream(OutputStream out, CompressorStreamsFactory ioStreamsFactory) | |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides java. Implements java. Closes this stream.
| |
| ensureOpen | back to summary |
|---|---|
| private void ensureOpen() throws IOException Ensures that this
| |
| finalizeWrite | back to summary |
|---|---|
| private void finalizeWrite() throws IOException Finalizes the writing of the compressed
| |
| isFrameHeaderBuffered | back to summary |
|---|---|
| private boolean isFrameHeaderBuffered() Checks if there is a complete frame header already buffered.
| |
| isFrameHeaderWriteComplete | back to summary |
|---|---|
| private boolean isFrameHeaderWriteComplete() Checks if the entire frame X Protocol frame header has been fully written.
| |
| isPayloadWriteReady | back to summary |
|---|---|
| private boolean isPayloadWriteReady() Checks if the X Protocol frame payload is ready to be written on the underlying
| |
| isWriteComplete | back to summary |
|---|---|
| private boolean isWriteComplete() Checks if current X Protocol frame has been fully written.
| |
| peekFrameHeader | back to summary |
|---|---|
| private int peekFrameHeader(byte[] b, int off, int len) Captures the first bytes of each X Protocol frame into a byte buffer.
| |
| write | back to summary |
|---|---|
| public void write(int b) throws IOException Overrides java. Forwards the write to
| |
| write | back to summary |
|---|---|
| public void write(byte[] b) throws IOException Overrides java. Forwards the write to
| |
| write | back to summary |
|---|---|
| public void write(byte[] b, int off, int len) throws IOException Overrides java. Analyzes the given bytes as an X Protocol frame and, depending on its size, writes it as-is in the underlying
| |