public class CompressionSplittedOutputStream
extends java.io.FilterOutputStream
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.| Constructor and Description |
|---|
CompressionSplittedOutputStream(java.io.OutputStream out,
CompressorStreamsFactory ioStreamsFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this stream.
|
void |
write(byte[] b)
Forwards the write to
write(byte[], int, int); |
void |
write(byte[] b,
int off,
int len)
Analyzes the given bytes as an X Protocol frame and, depending on its size, writes it as-is in the underlying
OutputStream or rebuilds it as a
compressed X Protocol packet. |
void |
write(int b)
Forwards the write to
write(byte[], int, int); |
public CompressionSplittedOutputStream(java.io.OutputStream out,
CompressorStreamsFactory ioStreamsFactory)
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.FilterOutputStreamjava.io.IOExceptionFilterOutputStream.close()public void write(int b)
throws java.io.IOException
write(byte[], int, int);write in class java.io.FilterOutputStreamjava.io.IOExceptionFilterOutputStream.write(int)public void write(byte[] b)
throws java.io.IOException
write(byte[], int, int);write in class java.io.FilterOutputStreamjava.io.IOExceptionFilterOutputStream.write(byte[])public void write(byte[] b,
int off,
int len)
throws java.io.IOException
OutputStream or rebuilds it as a
compressed X Protocol packet.write in class java.io.FilterOutputStreamjava.io.IOExceptionFilterOutputStream.write(int)