public class TCompactProtocol extends TProtocol
| Modifier and Type | Class and Description |
|---|---|
static class |
TCompactProtocol.Factory
TProtocolFactory that produces TCompactProtocols.
|
| Constructor and Description |
|---|
TCompactProtocol(TTransport transport)
Create a TCompactProtocol.
|
TCompactProtocol(TTransport transport,
long stringLengthLimit)
Deprecated.
Use constructor specifying both string limit and container limit instead
|
TCompactProtocol(TTransport transport,
long stringLengthLimit,
long containerLengthLimit)
Create a TCompactProtocol.
|
| Modifier and Type | Method and Description |
|---|---|
java.nio.ByteBuffer |
readBinary()
Read a byte[] from the wire.
|
boolean |
readBool()
Read a boolean off the wire.
|
byte |
readByte()
Read a single byte off the wire.
|
double |
readDouble()
No magic here - just read a double off the wire.
|
TField |
readFieldBegin()
Read a field header off the wire.
|
void |
readFieldEnd() |
short |
readI16()
Read an i16 from the wire as a zigzag varint.
|
int |
readI32()
Read an i32 from the wire as a zigzag varint.
|
long |
readI64()
Read an i64 from the wire as a zigzag varint.
|
TList |
readListBegin()
Read a list header off the wire.
|
void |
readListEnd() |
TMap |
readMapBegin()
Read a map header off the wire.
|
void |
readMapEnd() |
TMessage |
readMessageBegin()
Read a message header.
|
void |
readMessageEnd() |
TSet |
readSetBegin()
Read a set header off the wire.
|
void |
readSetEnd() |
java.lang.String |
readString()
Reads a byte[] (via readBinary), and then UTF-8 decodes it.
|
TStruct |
readStructBegin()
Read a struct begin.
|
void |
readStructEnd()
Doesn't actually consume any wire data, just removes the last field for
this struct from the field stack.
|
void |
reset()
Reset any internal state back to a blank slate.
|
void |
writeBinary(java.nio.ByteBuffer bin)
Write a byte array, using a varint for the size.
|
void |
writeBool(boolean b)
Write a boolean value.
|
void |
writeByte(byte b)
Write a byte.
|
protected void |
writeCollectionBegin(byte elemType,
int size)
Abstract method for writing the start of lists and sets.
|
void |
writeDouble(double dub)
Write a double to the wire as 8 bytes.
|
void |
writeFieldBegin(TField field)
Write a field header containing the field id and field type.
|
void |
writeFieldEnd() |
void |
writeFieldStop()
Write the STOP symbol so we know there are no more fields in this struct.
|
void |
writeI16(short i16)
Write an I16 as a zigzag varint.
|
void |
writeI32(int i32)
Write an i32 as a zigzag varint.
|
void |
writeI64(long i64)
Write an i64 as a zigzag varint.
|
void |
writeListBegin(TList list)
Write a list header.
|
void |
writeListEnd() |
void |
writeMapBegin(TMap map)
Write a map header.
|
void |
writeMapEnd() |
void |
writeMessageBegin(TMessage message)
Write a message header to the wire.
|
void |
writeMessageEnd() |
void |
writeSetBegin(TSet set)
Write a set header.
|
void |
writeSetEnd() |
void |
writeString(java.lang.String str)
Write a string to the wire with a varint size preceding.
|
void |
writeStructBegin(TStruct struct)
Write a struct begin.
|
void |
writeStructEnd()
Write a struct end.
|
getScheme, getTransportpublic TCompactProtocol(TTransport transport, long stringLengthLimit, long containerLengthLimit)
transport - the TTransport object to read from or write to.stringLengthLimit - the maximum number of bytes to read for
variable-length fields.containerLengthLimit - the maximum number of elements to read
for containers.@Deprecated public TCompactProtocol(TTransport transport, long stringLengthLimit)
transport - the TTransport object to read from or write to.stringLengthLimit - the maximum number of bytes to read for
variable-length fields.public TCompactProtocol(TTransport transport)
transport - the TTransport object to read from or write to.public void reset()
TProtocolpublic void writeMessageBegin(TMessage message) throws TException
writeMessageBegin in class TProtocolTExceptionpublic void writeStructBegin(TStruct struct) throws TException
writeStructBegin in class TProtocolTExceptionpublic void writeStructEnd()
throws TException
writeStructEnd in class TProtocolTExceptionpublic void writeFieldBegin(TField field) throws TException
writeFieldBegin in class TProtocolTExceptionpublic void writeFieldStop()
throws TException
writeFieldStop in class TProtocolTExceptionpublic void writeMapBegin(TMap map) throws TException
writeMapBegin in class TProtocolTExceptionpublic void writeListBegin(TList list) throws TException
writeListBegin in class TProtocolTExceptionpublic void writeSetBegin(TSet set) throws TException
writeSetBegin in class TProtocolTExceptionpublic void writeBool(boolean b)
throws TException
writeBool in class TProtocolTExceptionpublic void writeByte(byte b)
throws TException
writeByte in class TProtocolTExceptionpublic void writeI16(short i16)
throws TException
writeI16 in class TProtocolTExceptionpublic void writeI32(int i32)
throws TException
writeI32 in class TProtocolTExceptionpublic void writeI64(long i64)
throws TException
writeI64 in class TProtocolTExceptionpublic void writeDouble(double dub)
throws TException
writeDouble in class TProtocolTExceptionpublic void writeString(java.lang.String str)
throws TException
writeString in class TProtocolTExceptionpublic void writeBinary(java.nio.ByteBuffer bin)
throws TException
writeBinary in class TProtocolTExceptionpublic void writeMessageEnd()
throws TException
writeMessageEnd in class TProtocolTExceptionpublic void writeMapEnd()
throws TException
writeMapEnd in class TProtocolTExceptionpublic void writeListEnd()
throws TException
writeListEnd in class TProtocolTExceptionpublic void writeSetEnd()
throws TException
writeSetEnd in class TProtocolTExceptionpublic void writeFieldEnd()
throws TException
writeFieldEnd in class TProtocolTExceptionprotected void writeCollectionBegin(byte elemType,
int size)
throws TException
TExceptionpublic TMessage readMessageBegin() throws TException
readMessageBegin in class TProtocolTExceptionpublic TStruct readStructBegin() throws TException
readStructBegin in class TProtocolTExceptionpublic void readStructEnd()
throws TException
readStructEnd in class TProtocolTExceptionpublic TField readFieldBegin() throws TException
readFieldBegin in class TProtocolTExceptionpublic TMap readMapBegin() throws TException
readMapBegin in class TProtocolTExceptionpublic TList readListBegin() throws TException
readListBegin in class TProtocolTExceptionpublic TSet readSetBegin() throws TException
readSetBegin in class TProtocolTExceptionpublic boolean readBool()
throws TException
readBool in class TProtocolTExceptionpublic byte readByte()
throws TException
readByte in class TProtocolTExceptionpublic short readI16()
throws TException
readI16 in class TProtocolTExceptionpublic int readI32()
throws TException
readI32 in class TProtocolTExceptionpublic long readI64()
throws TException
readI64 in class TProtocolTExceptionpublic double readDouble()
throws TException
readDouble in class TProtocolTExceptionpublic java.lang.String readString()
throws TException
readString in class TProtocolTExceptionpublic java.nio.ByteBuffer readBinary()
throws TException
readBinary in class TProtocolTExceptionpublic void readMessageEnd()
throws TException
readMessageEnd in class TProtocolTExceptionpublic void readFieldEnd()
throws TException
readFieldEnd in class TProtocolTExceptionpublic void readMapEnd()
throws TException
readMapEnd in class TProtocolTExceptionpublic void readListEnd()
throws TException
readListEnd in class TProtocolTExceptionpublic void readSetEnd()
throws TException
readSetEnd in class TProtocolTException