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:
TLegacyUuidProtocolDecorator,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()doubleintvoidshortreadI16()intreadI32()longreadI64()voidvoidvoidvoidvoidreadUuid()voidreset()Reset any internal state back to a blank slate.protected voidprotected voidskipBool()The default implementation of all skip() methods calls the corresponding read() method.protected voidskipByte()protected voidprotected voidskipI16()protected voidskipI32()protected voidskipI64()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, decrementRecursionDepth, getScheme, getTransport, incrementRecursionDepth, readField, readList, readList, readList, readMap, readMap, readMap, readMap, readMap, readMessage, readSet, readSet, readSet, readStruct, skip, skip, skipBytes, 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
-
readFieldBeginData
- Overrides:
readFieldBeginDatain classTProtocol- Throws:
TException
-
skipBool
Description copied from class:TProtocolThe default implementation of all skip() methods calls the corresponding read() method. Protocols that derive from this class are strongly encouraged to provide a more efficient alternative.- Overrides:
skipBoolin classTProtocol- Throws:
TException
-
skipByte
- Overrides:
skipBytein classTProtocol- Throws:
TException
-
skipI16
- Overrides:
skipI16in classTProtocol- Throws:
TException
-
skipI32
- Overrides:
skipI32in classTProtocol- Throws:
TException
-
skipI64
- Overrides:
skipI64in classTProtocol- Throws:
TException
-
skipDouble
- Overrides:
skipDoublein classTProtocol- Throws:
TException
-
skipBinary
- Overrides:
skipBinaryin classTProtocol- 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
-
reset
public void reset()Description copied from class:TProtocolReset any internal state back to a blank slate. This method only needs to be implemented for stateful protocols.
-