Package org.apache.thrift.transport
Class TZlibTransport
java.lang.Object
org.apache.thrift.transport.TTransport
org.apache.thrift.transport.TEndpointTransport
org.apache.thrift.transport.TIOStreamTransport
org.apache.thrift.transport.TZlibTransport
- All Implemented Interfaces:
Closeable,AutoCloseable
TZlibTransport deflates on write and inflates on read.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class org.apache.thrift.transport.TIOStreamTransport
inputStream_, outputStream_Fields inherited from class org.apache.thrift.transport.TEndpointTransport
knownMessageSize, remainingMessageSize -
Constructor Summary
ConstructorsConstructorDescriptionTZlibTransport(TTransport transport) Constructs a new TZlibTransport instance.TZlibTransport(TTransport transport, int compressionLevel) Constructs a new TZlibTransport instance. -
Method Summary
Methods inherited from class org.apache.thrift.transport.TIOStreamTransport
flush, read, writeMethods inherited from class org.apache.thrift.transport.TEndpointTransport
checkReadBytesAvailable, countConsumedMessageBytes, getConfiguration, getMaxFrameSize, getMaxMessageSize, resetConsumedMessageSize, setMaxFrameSize, updateKnownMessageSizeMethods inherited from class org.apache.thrift.transport.TTransport
consumeBuffer, getBuffer, getBufferPosition, getBytesRemainingInBuffer, peek, read, readAll, write, write
-
Constructor Details
-
TZlibTransport
Constructs a new TZlibTransport instance.- Parameters:
transport- the underlying transport to read from and write to- Throws:
TTransportException
-
TZlibTransport
Constructs a new TZlibTransport instance.- Parameters:
transport- the underlying transport to read from and write tocompressionLevel- 0 for no compression, 9 for maximum compression- Throws:
TTransportException
-
-
Method Details
-
isOpen
public boolean isOpen()Description copied from class:TTransportQueries whether the transport is open.- Overrides:
isOpenin classTIOStreamTransport- Returns:
- false after close is called.
-
open
Description copied from class:TIOStreamTransportThe streams must already be open. This method does nothing.- Overrides:
openin classTIOStreamTransport- Throws:
TTransportException- if the transport could not be opened
-
close
public void close()Description copied from class:TIOStreamTransportCloses both the input and output streams.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classTIOStreamTransport
-