Package org.apache.thrift.protocol
Class TProtocolDecorator
- java.lang.Object
-
- org.apache.thrift.protocol.TProtocol
-
- org.apache.thrift.protocol.TProtocolDecorator
-
- All Implemented Interfaces:
TReadProtocol,TWriteProtocol
- Direct Known Subclasses:
TMultiplexedProtocol
public abstract class TProtocolDecorator extends TProtocol
TProtocolDecoratorforwards all requests to an enclosedTProtocolinstance, providing a way to author concise concrete decorator subclasses. While it has no abstract methods, it is marked abstract as a reminder that by itself, it does not modify the behaviour of the enclosedTProtocol.See p.175 of Design Patterns (by Gamma et al.)
- See Also:
TMultiplexedProtocol
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.thrift.protocol.TProtocol
TProtocol.ReadCallback<T,R>, TProtocol.ReadCollectionCallback<R>, TProtocol.ReadMapEntryCallback<K,V>, TProtocol.WriteCallback<T>
-
-
Field Summary
-
Fields inherited from class org.apache.thrift.protocol.TProtocol
skippedBytes, trans_
-
-
Constructor Summary
Constructors Constructor Description TProtocolDecorator(TProtocol protocol)Encloses the specified protocol.
-
Method Summary
-
Methods inherited from class org.apache.thrift.protocol.TProtocol
checkReadBytesAvailable, checkReadBytesAvailable, checkReadBytesAvailable, getScheme, getTransport, readField, readFieldBeginData, readList, readList, readList, readMap, readMap, readMap, readMessage, readSet, readSet, readSet, readStruct, reset, skip, skip, skipBinary, skipBool, skipByte, skipBytes, skipDouble, skipI16, skipI32, skipI64, writeField, writeList, writeMap, writeMessage, writeSet, writeStruct
-
-
-
-
Constructor Detail
-
TProtocolDecorator
public TProtocolDecorator(TProtocol protocol)
Encloses the specified protocol.- Parameters:
protocol- All operations will be forward to this protocol. Must be non-null.
-
-
Method Detail
-
writeMessageBegin
public void writeMessageBegin(TMessage tMessage) throws TException
- Throws:
TException
-
writeMessageEnd
public void writeMessageEnd() throws TException- Throws:
TException
-
writeStructBegin
public void writeStructBegin(TStruct tStruct) throws TException
- Throws:
TException
-
writeStructEnd
public void writeStructEnd() throws TException- Throws:
TException
-
writeFieldBegin
public void writeFieldBegin(TField tField) throws TException
- Throws:
TException
-
writeFieldEnd
public void writeFieldEnd() throws TException- Throws:
TException
-
writeFieldStop
public void writeFieldStop() throws TException- Throws:
TException
-
writeMapBegin
public void writeMapBegin(TMap tMap) throws TException
- Throws:
TException
-
writeMapEnd
public void writeMapEnd() throws TException- Throws:
TException
-
writeListBegin
public void writeListBegin(TList tList) throws TException
- Throws:
TException
-
writeListEnd
public void writeListEnd() throws TException- Throws:
TException
-
writeSetBegin
public void writeSetBegin(TSet tSet) throws TException
- Throws:
TException
-
writeSetEnd
public void writeSetEnd() throws TException- Throws:
TException
-
writeBool
public void writeBool(boolean b) throws TException- Throws:
TException
-
writeByte
public void writeByte(byte b) throws TException- Throws:
TException
-
writeI16
public void writeI16(short i) throws TException- Throws:
TException
-
writeI32
public void writeI32(int i) throws TException- Throws:
TException
-
writeI64
public void writeI64(long l) throws TException- Throws:
TException
-
writeDouble
public void writeDouble(double v) throws TException- Throws:
TException
-
writeString
public void writeString(java.lang.String s) throws TException- Throws:
TException
-
writeBinary
public void writeBinary(java.nio.ByteBuffer buf) throws TException- Throws:
TException
-
readMessageBegin
public TMessage readMessageBegin() throws TException
- Throws:
TException
-
readMessageEnd
public void readMessageEnd() throws TException- Throws:
TException
-
readStructBegin
public TStruct readStructBegin() throws TException
- Throws:
TException
-
readStructEnd
public void readStructEnd() throws TException- Throws:
TException
-
readFieldBegin
public TField readFieldBegin() throws TException
- Throws:
TException
-
readFieldEnd
public void readFieldEnd() throws TException- Throws:
TException
-
readMapBegin
public TMap readMapBegin() throws TException
- Throws:
TException
-
readMapEnd
public void readMapEnd() throws TException- Throws:
TException
-
readListBegin
public TList readListBegin() throws TException
- Throws:
TException
-
readListEnd
public void readListEnd() throws TException- Throws:
TException
-
readSetBegin
public TSet readSetBegin() throws TException
- Throws:
TException
-
readSetEnd
public void readSetEnd() throws TException- Throws:
TException
-
readBool
public boolean readBool() throws TException- Throws:
TException
-
readByte
public byte readByte() throws TException- Throws:
TException
-
readI16
public short readI16() throws TException- Throws:
TException
-
readI32
public int readI32() throws TException- Throws:
TException
-
readI64
public long readI64() throws TException- Throws:
TException
-
readDouble
public double readDouble() throws TException- Throws:
TException
-
readString
public java.lang.String readString() throws TException- Throws:
TException
-
readBinary
public java.nio.ByteBuffer readBinary() throws TException- Throws:
TException
-
getMinSerializedSize
public int getMinSerializedSize(byte type) throws TExceptionDescription copied from class:TProtocolReturn min serialized size in bytes- Specified by:
getMinSerializedSizein classTProtocol- Parameters:
type- Returns the minimum amount of bytes needed to store the smallest possible instance of TType.- Returns:
- Throws:
TException
-
-