org.apache.thrift.protocol
Class TBinaryProtocol

java.lang.Object
  extended by org.apache.thrift.protocol.TProtocol
      extended by org.apache.thrift.protocol.TBinaryProtocol

public class TBinaryProtocol
extends TProtocol

Binary protocol implementation for thrift.


Nested Class Summary
static class TBinaryProtocol.Factory
          Factory
 
Field Summary
protected  boolean checkReadLength_
           
protected  int readLength_
           
protected  boolean strictRead_
           
protected  boolean strictWrite_
           
protected static int VERSION_1
           
protected static int VERSION_MASK
           
 
Fields inherited from class org.apache.thrift.protocol.TProtocol
trans_
 
Constructor Summary
TBinaryProtocol(TTransport trans)
          Constructor
TBinaryProtocol(TTransport trans, boolean strictRead, boolean strictWrite)
           
 
Method Summary
protected  void checkReadLength(int length)
           
 java.nio.ByteBuffer readBinary()
           
 boolean readBool()
           
 byte readByte()
           
 double readDouble()
           
 TField readFieldBegin()
           
 void readFieldEnd()
           
 short readI16()
           
 int readI32()
           
 long readI64()
           
 TList readListBegin()
           
 void readListEnd()
           
 TMap readMapBegin()
           
 void readMapEnd()
           
 TMessage readMessageBegin()
          Reading methods.
 void readMessageEnd()
           
 TSet readSetBegin()
           
 void readSetEnd()
           
 java.lang.String readString()
           
 java.lang.String readStringBody(int size)
           
 TStruct readStructBegin()
           
 void readStructEnd()
           
 void setReadLength(int readLength)
           
 void writeBinary(java.nio.ByteBuffer bin)
           
 void writeBool(boolean b)
           
 void writeByte(byte b)
           
 void writeDouble(double dub)
           
 void writeFieldBegin(TField field)
           
 void writeFieldEnd()
           
 void writeFieldStop()
           
 void writeI16(short i16)
           
 void writeI32(int i32)
           
 void writeI64(long i64)
           
 void writeListBegin(TList list)
           
 void writeListEnd()
           
 void writeMapBegin(TMap map)
           
 void writeMapEnd()
           
 void writeMessageBegin(TMessage message)
          Writing methods.
 void writeMessageEnd()
           
 void writeSetBegin(TSet set)
           
 void writeSetEnd()
           
 void writeString(java.lang.String str)
           
 void writeStructBegin(TStruct struct)
           
 void writeStructEnd()
           
 
Methods inherited from class org.apache.thrift.protocol.TProtocol
getScheme, getTransport, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION_MASK

protected static final int VERSION_MASK
See Also:
Constant Field Values

VERSION_1

protected static final int VERSION_1
See Also:
Constant Field Values

strictRead_

protected boolean strictRead_

strictWrite_

protected boolean strictWrite_

readLength_

protected int readLength_

checkReadLength_

protected boolean checkReadLength_
Constructor Detail

TBinaryProtocol

public TBinaryProtocol(TTransport trans)
Constructor


TBinaryProtocol

public TBinaryProtocol(TTransport trans,
                       boolean strictRead,
                       boolean strictWrite)
Method Detail

writeMessageBegin

public void writeMessageBegin(TMessage message)
                       throws TException
Description copied from class: TProtocol
Writing methods.

Specified by:
writeMessageBegin in class TProtocol
Throws:
TException

writeMessageEnd

public void writeMessageEnd()
Specified by:
writeMessageEnd in class TProtocol

writeStructBegin

public void writeStructBegin(TStruct struct)
Specified by:
writeStructBegin in class TProtocol

writeStructEnd

public void writeStructEnd()
Specified by:
writeStructEnd in class TProtocol

writeFieldBegin

public void writeFieldBegin(TField field)
                     throws TException
Specified by:
writeFieldBegin in class TProtocol
Throws:
TException

writeFieldEnd

public void writeFieldEnd()
Specified by:
writeFieldEnd in class TProtocol

writeFieldStop

public void writeFieldStop()
                    throws TException
Specified by:
writeFieldStop in class TProtocol
Throws:
TException

writeMapBegin

public void writeMapBegin(TMap map)
                   throws TException
Specified by:
writeMapBegin in class TProtocol
Throws:
TException

writeMapEnd

public void writeMapEnd()
Specified by:
writeMapEnd in class TProtocol

writeListBegin

public void writeListBegin(TList list)
                    throws TException
Specified by:
writeListBegin in class TProtocol
Throws:
TException

writeListEnd

public void writeListEnd()
Specified by:
writeListEnd in class TProtocol

writeSetBegin

public void writeSetBegin(TSet set)
                   throws TException
Specified by:
writeSetBegin in class TProtocol
Throws:
TException

writeSetEnd

public void writeSetEnd()
Specified by:
writeSetEnd in class TProtocol

writeBool

public void writeBool(boolean b)
               throws TException
Specified by:
writeBool in class TProtocol
Throws:
TException

writeByte

public void writeByte(byte b)
               throws TException
Specified by:
writeByte in class TProtocol
Throws:
TException

writeI16

public void writeI16(short i16)
              throws TException
Specified by:
writeI16 in class TProtocol
Throws:
TException

writeI32

public void writeI32(int i32)
              throws TException
Specified by:
writeI32 in class TProtocol
Throws:
TException

writeI64

public void writeI64(long i64)
              throws TException
Specified by:
writeI64 in class TProtocol
Throws:
TException

writeDouble

public void writeDouble(double dub)
                 throws TException
Specified by:
writeDouble in class TProtocol
Throws:
TException

writeString

public void writeString(java.lang.String str)
                 throws TException
Specified by:
writeString in class TProtocol
Throws:
TException

writeBinary

public void writeBinary(java.nio.ByteBuffer bin)
                 throws TException
Specified by:
writeBinary in class TProtocol
Throws:
TException

readMessageBegin

public TMessage readMessageBegin()
                          throws TException
Reading methods.

Specified by:
readMessageBegin in class TProtocol
Throws:
TException

readMessageEnd

public void readMessageEnd()
Specified by:
readMessageEnd in class TProtocol

readStructBegin

public TStruct readStructBegin()
Specified by:
readStructBegin in class TProtocol

readStructEnd

public void readStructEnd()
Specified by:
readStructEnd in class TProtocol

readFieldBegin

public TField readFieldBegin()
                      throws TException
Specified by:
readFieldBegin in class TProtocol
Throws:
TException

readFieldEnd

public void readFieldEnd()
Specified by:
readFieldEnd in class TProtocol

readMapBegin

public TMap readMapBegin()
                  throws TException
Specified by:
readMapBegin in class TProtocol
Throws:
TException

readMapEnd

public void readMapEnd()
Specified by:
readMapEnd in class TProtocol

readListBegin

public TList readListBegin()
                    throws TException
Specified by:
readListBegin in class TProtocol
Throws:
TException

readListEnd

public void readListEnd()
Specified by:
readListEnd in class TProtocol

readSetBegin

public TSet readSetBegin()
                  throws TException
Specified by:
readSetBegin in class TProtocol
Throws:
TException

readSetEnd

public void readSetEnd()
Specified by:
readSetEnd in class TProtocol

readBool

public boolean readBool()
                 throws TException
Specified by:
readBool in class TProtocol
Throws:
TException

readByte

public byte readByte()
              throws TException
Specified by:
readByte in class TProtocol
Throws:
TException

readI16

public short readI16()
              throws TException
Specified by:
readI16 in class TProtocol
Throws:
TException

readI32

public int readI32()
            throws TException
Specified by:
readI32 in class TProtocol
Throws:
TException

readI64

public long readI64()
             throws TException
Specified by:
readI64 in class TProtocol
Throws:
TException

readDouble

public double readDouble()
                  throws TException
Specified by:
readDouble in class TProtocol
Throws:
TException

readString

public java.lang.String readString()
                            throws TException
Specified by:
readString in class TProtocol
Throws:
TException

readStringBody

public java.lang.String readStringBody(int size)
                                throws TException
Throws:
TException

readBinary

public java.nio.ByteBuffer readBinary()
                               throws TException
Specified by:
readBinary in class TProtocol
Throws:
TException

setReadLength

public void setReadLength(int readLength)

checkReadLength

protected void checkReadLength(int length)
                        throws TException
Throws:
TException