Package org.apache.thrift.transport
Class TZlibTransport
- java.lang.Object
-
- org.apache.thrift.transport.TTransport
-
- org.apache.thrift.transport.TIOStreamTransport
-
- org.apache.thrift.transport.TZlibTransport
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class TZlibTransport extends TIOStreamTransport
TZlibTransport deflates on write and inflates on read.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTZlibTransport.Factory
-
Field Summary
-
Fields inherited from class org.apache.thrift.transport.TIOStreamTransport
inputStream_, outputStream_
-
-
Constructor Summary
Constructors Constructor Description TZlibTransport(TTransport transport)Constructs a new TZlibTransport instance.TZlibTransport(TTransport transport, int compressionLevel)Constructs a new TZlibTransport instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes both the input and output streams.booleanisOpen()Queries whether the transport is open.voidopen()The streams must already be open.-
Methods inherited from class org.apache.thrift.transport.TIOStreamTransport
flush, read, write
-
Methods inherited from class org.apache.thrift.transport.TTransport
consumeBuffer, getBuffer, getBufferPosition, getBytesRemainingInBuffer, peek, readAll, write
-
-
-
-
Constructor Detail
-
TZlibTransport
public TZlibTransport(TTransport transport)
Constructs a new TZlibTransport instance.- Parameters:
transport- the underlying transport to read from and write to
-
TZlibTransport
public TZlibTransport(TTransport transport, int compressionLevel)
Constructs a new TZlibTransport instance.- Parameters:
transport- the underlying transport to read from and write tocompressionLevel- 0 for no compression, 9 for maximum compression
-
-
Method Detail
-
isOpen
public boolean isOpen()
Description copied from class:TTransportQueries whether the transport is open.- Overrides:
isOpenin classTIOStreamTransport- Returns:
- false after close is called.
-
open
public void open() throws TTransportExceptionDescription 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 interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classTIOStreamTransport
-
-