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
TProtocolDecorator
forwards all requests to an enclosed TProtocol
instance, 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 enclosed TProtocol
.
See p.175 of Design Patterns (by Gamma et al.)
- See Also:
-
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
-
Method Summary
Modifier and TypeMethodDescriptionint
getMinSerializedSize
(byte type) Return min serialized size in bytesboolean
readBool()
byte
readByte()
double
void
short
readI16()
int
readI32()
long
readI64()
void
void
void
void
void
readUuid()
void
writeBinary
(ByteBuffer buf) void
writeBool
(boolean b) void
writeByte
(byte b) void
writeDouble
(double v) void
writeFieldBegin
(TField tField) void
void
void
writeI16
(short i) void
writeI32
(int i) void
writeI64
(long l) void
writeListBegin
(TList tList) void
void
writeMapBegin
(TMap tMap) void
void
writeMessageBegin
(TMessage tMessage) void
void
writeSetBegin
(TSet tSet) void
void
void
writeStructBegin
(TStruct tStruct) void
void
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 Details
-
TProtocolDecorator
Encloses the specified protocol.- Parameters:
protocol
- All operations will be forward to this protocol. Must be non-null.
-
-
Method Details
-
writeMessageBegin
- Throws:
TException
-
writeMessageEnd
- Throws:
TException
-
writeStructBegin
- Throws:
TException
-
readUuid
- Throws:
TException
-
writeUuid
- Throws:
TException
-
writeStructEnd
- Throws:
TException
-
writeFieldBegin
- Throws:
TException
-
writeFieldEnd
- Throws:
TException
-
writeFieldStop
- Throws:
TException
-
writeMapBegin
- Throws:
TException
-
writeMapEnd
- Throws:
TException
-
writeListBegin
- Throws:
TException
-
writeListEnd
- Throws:
TException
-
writeSetBegin
- Throws:
TException
-
writeSetEnd
- Throws:
TException
-
writeBool
- Throws:
TException
-
writeByte
- Throws:
TException
-
writeI16
- Throws:
TException
-
writeI32
- Throws:
TException
-
writeI64
- Throws:
TException
-
writeDouble
- Throws:
TException
-
writeString
- Throws:
TException
-
writeBinary
- Throws:
TException
-
readMessageBegin
- Throws:
TException
-
readMessageEnd
- Throws:
TException
-
readStructBegin
- Throws:
TException
-
readStructEnd
- Throws:
TException
-
readFieldBegin
- Throws:
TException
-
readFieldEnd
- Throws:
TException
-
readMapBegin
- Throws:
TException
-
readMapEnd
- Throws:
TException
-
readListBegin
- Throws:
TException
-
readListEnd
- Throws:
TException
-
readSetBegin
- Throws:
TException
-
readSetEnd
- Throws:
TException
-
readBool
- Throws:
TException
-
readByte
- Throws:
TException
-
readI16
- Throws:
TException
-
readI32
- Throws:
TException
-
readI64
- Throws:
TException
-
readDouble
- Throws:
TException
-
readString
- Throws:
TException
-
readBinary
- Throws:
TException
-
getMinSerializedSize
Description copied from class:TProtocol
Return min serialized size in bytes- Specified by:
getMinSerializedSize
in classTProtocol
- Parameters:
type
- Returns the minimum amount of bytes needed to store the smallest possible instance of TType.- Returns:
- size
- Throws:
TException
- if underlying protocol throws
-