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 boolean
protected boolean
protected static final int
protected static final int
Fields 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 TypeMethodDescriptionint
getMinSerializedSize
(byte type) Return the minimum number of bytes a type will consume on the wireboolean
readBool()
byte
readByte()
double
int
void
short
readI16()
int
readI32()
long
readI64()
void
void
Reading methods.void
void
readStringBody
(int size) void
readUuid()
protected void
protected void
skipBool()
The default implementation of all skip() methods calls the corresponding read() method.protected void
skipByte()
protected void
protected void
skipI16()
protected void
skipI32()
protected void
skipI64()
void
writeBinary
(ByteBuffer bin) void
writeBool
(boolean b) void
writeByte
(byte b) void
writeDouble
(double dub) void
writeFieldBegin
(TField field) void
void
void
writeI16
(short i16) void
writeI32
(int i32) void
writeI64
(long i64) void
writeListBegin
(TList list) void
void
writeMapBegin
(TMap map) void
void
writeMessageBegin
(TMessage message) void
void
writeSetBegin
(TSet set) void
void
writeString
(String str) void
writeStructBegin
(TStruct struct) void
void
Methods 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:
getMinSerializedSize
in 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:
readFieldBeginData
in classTProtocol
- Throws:
TException
-
skipBool
Description copied from class:TProtocol
The 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:
skipBool
in classTProtocol
- Throws:
TException
-
skipByte
- Overrides:
skipByte
in classTProtocol
- Throws:
TException
-
skipI16
- Overrides:
skipI16
in classTProtocol
- Throws:
TException
-
skipI32
- Overrides:
skipI32
in classTProtocol
- Throws:
TException
-
skipI64
- Overrides:
skipI64
in classTProtocol
- Throws:
TException
-
skipDouble
- Overrides:
skipDouble
in classTProtocol
- Throws:
TException
-
skipBinary
- Overrides:
skipBinary
in classTProtocol
- Throws:
TException
-