Package org.apache.thrift.protocol
Class TBinaryProtocol
java.lang.Object
org.apache.thrift.protocol.TProtocol
org.apache.thrift.protocol.TBinaryProtocol
- All Implemented Interfaces:
TReadProtocol,TWriteProtocol
Binary protocol implementation for thrift.
-
Nested Class Summary
Nested ClassesNested 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
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanprotected static final intprotected static final intFields inherited from class org.apache.thrift.protocol.TProtocol
skippedBytes, trans_ -
Constructor Summary
ConstructorsConstructorDescriptionTBinaryProtocol(TTransport trans) ConstructorTBinaryProtocol(TTransport trans, boolean strictRead, boolean strictWrite) TBinaryProtocol(TTransport trans, long stringLengthLimit, long containerLengthLimit) TBinaryProtocol(TTransport trans, long stringLengthLimit, long containerLengthLimit, boolean strictRead, boolean strictWrite) -
Method Summary
Modifier and TypeMethodDescriptionintgetMinSerializedSize(byte type) Return the minimum number of bytes a type will consume on the wirebooleanreadBool()bytereadByte()doubleintvoidshortreadI16()intreadI32()longreadI64()voidvoidReading methods.voidvoidreadStringBody(int size) voidreadUuid()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 bin) voidwriteBool(boolean b) voidwriteByte(byte b) voidwriteDouble(double dub) voidwriteFieldBegin(TField field) voidvoidvoidwriteI16(short i16) voidwriteI32(int i32) voidwriteI64(long i64) voidwriteListBegin(TList list) voidvoidwriteMapBegin(TMap map) voidvoidwriteMessageBegin(TMessage message) voidvoidwriteSetBegin(TSet set) voidvoidwriteString(String str) voidwriteStructBegin(TStruct struct) voidvoidMethods inherited from class org.apache.thrift.protocol.TProtocol
checkReadBytesAvailable, checkReadBytesAvailable, checkReadBytesAvailable, getScheme, getTransport, readField, readList, readList, readList, readMap, readMap, readMap, readMessage, readSet, readSet, readSet, readStruct, reset, skip, skip, skipBytes, writeField, writeList, writeMap, writeMessage, writeSet, writeStruct
-
Field Details
-
VERSION_MASK
protected static final int VERSION_MASK- See Also:
-
VERSION_1
protected static final int VERSION_1- See Also:
-
strictRead_
protected boolean strictRead_ -
strictWrite_
protected boolean strictWrite_
-
-
Constructor Details
-
TBinaryProtocol
Constructor -
TBinaryProtocol
-
TBinaryProtocol
-
TBinaryProtocol
public TBinaryProtocol(TTransport trans, long stringLengthLimit, long containerLengthLimit, boolean strictRead, boolean strictWrite)
-
-
Method Details
-
writeMessageBegin
- Throws:
TException
-
writeMessageEnd
- Throws:
TException
-
writeStructBegin
- 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
-
writeUuid
- Throws:
TException
-
writeDouble
- Throws:
TException
-
writeString
- Throws:
TException
-
writeBinary
- Throws:
TException
-
readMessageBegin
Reading methods.- 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
-
readUuid
- Throws:
TException
-
readDouble
- Throws:
TException
-
readString
- Throws:
TException
-
readStringBody
- Throws:
TException
-
readBinary
- Throws:
TException
-
getMinSerializedSize
Return the minimum number of bytes a type will consume on the wire- Specified by:
getMinSerializedSizein classTProtocol- Parameters:
type- Returns the minimum amount of bytes needed to store the smallest possible instance of TType.- Returns:
- min serialized size
- Throws:
TTransportException
-
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
-