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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetMinSerializedSize(byte type) Return min serialized size in bytesbooleanreadBool()bytereadByte()doublevoidshortreadI16()intreadI32()longreadI64()voidvoidvoidvoidvoidreadUuid()voidwriteBinary(ByteBuffer buf) voidwriteBool(boolean b) voidwriteByte(byte b) voidwriteDouble(double v) voidwriteFieldBegin(TField tField) voidvoidvoidwriteI16(short i) voidwriteI32(int i) voidwriteI64(long l) voidwriteListBegin(TList tList) voidvoidwriteMapBegin(TMap tMap) voidvoidwriteMessageBegin(TMessage tMessage) voidvoidwriteSetBegin(TSet tSet) voidvoidvoidwriteStructBegin(TStruct tStruct) voidvoidMethods 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: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:
- size
- Throws:
TException- if underlying protocol throws
-