InputStream wrapper that analyzes X Protocol frames and, if compressed, routes them to a secondary compressor-able InputStream that also
knows how to rebuild uncompressed X Protocol frames from compressed ones.
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private InputStream | |
| private CompressorStreamsFactory | |
| private byte[] | |
| private int | |
| private int | |
| private int | |
| private byte[] | |
| private XMessageHeader |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: an approximate number of available bytes to read.Overrides java. Same as |
| public void | close()
Overrides java. Implements java. Closes this stream. |
| private void | |
| private boolean | Returns: true if there is compressed data available, false otherwise.Checks if there is data available in the compressed |
| private boolean | Returns: true if all compressed data was consumed, false otherwise.Checks if all data from the compressed |
| private boolean | Returns: true if the type of current frame is com., false
otherwise.Checks if current X Protocol frame is compressed. |
| private boolean | Returns: true if this frame's bytes weren't all consumed yet, false otherwise.Checks if there is data available to be consumed. |
| pack-priv boolean | Returns: true if the frame header was fully consumed, false otherwise.Checks if the X Protocol frame header was fully consumed. |
| private MysqlxConnection. | Returns: The ProtobufCompression message.Parses the next X Protocol message as a compressed one. |
| private void | peekNextFrame()
Checks the header of the next X Protocol frame and, depending on its type, sets up this class to read from an alternative compressor able underlying
|
| public int | |
| public int | read(byte[]
the buffer into which the data is read. b)Overrides java. Forwards the read to |
| public int | read(byte[]
the buffer into which the data is read. b, int the start offset in array off, int b
at which the data is written.the maximum number of bytes to read. len)Overrides java. Reads bytes from the underlying |
| public int | Returns: the total number of bytes read into the buffer, or-1 if there is no more data because the end of the stream has been reached.the buffer into which the data is read. b)Reads the number of bytes required to fill the given buffer from the underlying |
| private final int | Returns: the total number of bytes read into the buffer, or-1 if there is no more data because the end of the stream has been reached.the buffer into which the data is read. b, int the start offset in the destination array off, int bthe maximum number of bytes read. len)Reads the exact number of requested bytes from the underlying |
| private final int | Returns: the total number of bytes read into the buffer, or-1 if there is no more data because the end of the stream has been reached.input stream to read from inStream, byte[] the buffer into which the data is read. b, int the start offset in the destination array off, int bthe maximum number of bytes read. len)Reads the exact number of requested bytes from the given |
| closed | back to summary |
|---|---|
| private boolean closed | |
| compressorIn | back to summary |
|---|---|
| private InputStream compressorIn | |
| compressorIoStreamsFactory | back to summary |
|---|---|
| private CompressorStreamsFactory compressorIoStreamsFactory | |
| frameHeader | back to summary |
|---|---|
| private byte[] frameHeader | |
| frameHeaderConsumed | back to summary |
|---|---|
| private int frameHeaderConsumed | |
| framePayloadConsumed | back to summary |
|---|---|
| private int framePayloadConsumed | |
| framePayloadLength | back to summary |
|---|---|
| private int framePayloadLength | |
| singleByte | back to summary |
|---|---|
| private byte[] singleByte | |
| xMessageHeader | back to summary |
|---|---|
| private XMessageHeader xMessageHeader | |
| CompressionSplittedInputStream | back to summary |
|---|---|
| public CompressionSplittedInputStream(InputStream in, CompressorStreamsFactory streamsFactory) | |
| available | back to summary |
|---|---|
| public int available() throws IOException Overrides java. Same as
| |
| 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
| |
| isCompressedDataAvailable | back to summary |
|---|---|
| private boolean isCompressedDataAvailable() throws IOException Checks if there is data available in the compressed
| |
| isCompressedDataReadComplete | back to summary |
|---|---|
| private boolean isCompressedDataReadComplete() throws IOException Checks if all data from the compressed
| |
| isCompressedFrame | back to summary |
|---|---|
| private boolean isCompressedFrame() Checks if current X Protocol frame is compressed.
| |
| isDataAvailable | back to summary |
|---|---|
| private boolean isDataAvailable() throws IOException Checks if there is data available to be consumed.
| |
| isFrameHeaderFullyConsumed | back to summary |
|---|---|
| pack-priv boolean isFrameHeaderFullyConsumed() Checks if the X Protocol frame header was fully consumed.
| |
| parseCompressedMessage | back to summary |
|---|---|
| private MysqlxConnection. Parses the next X Protocol message as a compressed one.
| |
| peekNextFrame | back to summary |
|---|---|
| private void peekNextFrame() throws IOException Checks the header of the next X Protocol frame and, depending on its type, sets up this class to read from an alternative compressor able underlying
| |
| read | back to summary |
|---|---|
| public int read() throws IOException Overrides java. Forwards the read to
| |
| read | back to summary |
|---|---|
| public int read(byte[] b) throws IOException Overrides java. Forwards the read to
| |
| read | back to summary |
|---|---|
| public int read(byte[] b, int off, int len) throws IOException Overrides java. Reads bytes from the underlying
| |
| readFully | back to summary |
|---|---|
| public int readFully(byte[] b) throws IOException Reads the number of bytes required to fill the given buffer from the underlying
| |
| readFully | back to summary |
|---|---|
| private final int readFully(byte[] b, int off, int len) throws IOException Reads the exact number of requested bytes from the underlying
| |
| readFully | back to summary |
|---|---|
| private final int readFully(InputStream inStream, byte[] b, int off, int len) throws IOException Reads the exact number of requested bytes from the given
| |