TProtocol

Interface for a Thrift protocol implementation. Essentially, it defines a way of reading and writing all the base types, plus a mechanism for writing out structs with indexed fields.

TProtocol objects should not be shared across multiple encoding contexts, as they may need to maintain internal state in some protocols (e.g. JSON). Note that is is acceptable for the TProtocol module to do its own internal buffered reads/writes to the underlying TTransport where appropriate (i.e. when parsing an input XML stream, reading could be batched rather than looking ahead character by character for a close tag).

Members

Functions

readBinary
ubyte[] readBinary()
Undocumented in source.
readBool
bool readBool()
Undocumented in source.
readByte
byte readByte()
Undocumented in source.
readDouble
double readDouble()
Undocumented in source.
readFieldBegin
TField readFieldBegin()
Undocumented in source.
readFieldEnd
void readFieldEnd()
Undocumented in source.
readI16
short readI16()
Undocumented in source.
readI32
int readI32()
Undocumented in source.
readI64
long readI64()
Undocumented in source.
readListBegin
TList readListBegin()
Undocumented in source.
readListEnd
void readListEnd()
Undocumented in source.
readMapBegin
TMap readMapBegin()
Undocumented in source.
readMapEnd
void readMapEnd()
Undocumented in source.
readMessageBegin
TMessage readMessageBegin()
Undocumented in source.
readMessageEnd
void readMessageEnd()
Undocumented in source.
readSetBegin
TSet readSetBegin()
Undocumented in source.
readSetEnd
void readSetEnd()
Undocumented in source.
readString
string readString()
Undocumented in source.
readStructBegin
TStruct readStructBegin()
Undocumented in source.
readStructEnd
void readStructEnd()
Undocumented in source.
reset
void reset()

Reset any internal state back to a blank slate, if the protocol is stateful.

transport
TTransport transport()

The underlying transport used by the protocol.

writeBinary
void writeBinary(ubyte[] buf)
Undocumented in source.
writeBool
void writeBool(bool b)
Undocumented in source.
writeByte
void writeByte(byte b)
Undocumented in source.
writeDouble
void writeDouble(double dub)
Undocumented in source.
writeFieldBegin
void writeFieldBegin(TField field)
Undocumented in source.
writeFieldEnd
void writeFieldEnd()
Undocumented in source.
writeFieldStop
void writeFieldStop()
Undocumented in source.
writeI16
void writeI16(short i16)
Undocumented in source.
writeI32
void writeI32(int i32)
Undocumented in source.
writeI64
void writeI64(long i64)
Undocumented in source.
writeListBegin
void writeListBegin(TList list)
Undocumented in source.
writeListEnd
void writeListEnd()
Undocumented in source.
writeMapBegin
void writeMapBegin(TMap map)
Undocumented in source.
writeMapEnd
void writeMapEnd()
Undocumented in source.
writeMessageBegin
void writeMessageBegin(TMessage message)
Undocumented in source.
writeMessageEnd
void writeMessageEnd()
Undocumented in source.
writeSetBegin
void writeSetBegin(TSet set)
Undocumented in source.
writeSetEnd
void writeSetEnd()
Undocumented in source.
writeString
void writeString(string str)
Undocumented in source.
writeStructBegin
void writeStructBegin(TStruct tstruct)
Undocumented in source.
writeStructEnd
void writeStructEnd()
Undocumented in source.

Meta