org.apache.thrift.protocol
Class TProtocol

java.lang.Object
  extended by org.apache.thrift.protocol.TProtocol
Direct Known Subclasses:
TBinaryProtocol, TCompactProtocol, TJSONProtocol, TProtocolDecorator, TSimpleJSONProtocol

public abstract class TProtocol
extends java.lang.Object

Protocol interface definition.


Field Summary
protected  TTransport trans_
          Transport
 
Constructor Summary
protected TProtocol(TTransport trans)
          Constructor
 
Method Summary
 java.lang.Class<? extends IScheme> getScheme()
          Scheme accessor
 TTransport getTransport()
          Transport accessor
abstract  java.nio.ByteBuffer readBinary()
           
abstract  boolean readBool()
           
abstract  byte readByte()
           
abstract  double readDouble()
           
abstract  TField readFieldBegin()
           
abstract  void readFieldEnd()
           
abstract  short readI16()
           
abstract  int readI32()
           
abstract  long readI64()
           
abstract  TList readListBegin()
           
abstract  void readListEnd()
           
abstract  TMap readMapBegin()
           
abstract  void readMapEnd()
           
abstract  TMessage readMessageBegin()
          Reading methods.
abstract  void readMessageEnd()
           
abstract  TSet readSetBegin()
           
abstract  void readSetEnd()
           
abstract  java.lang.String readString()
           
abstract  TStruct readStructBegin()
           
abstract  void readStructEnd()
           
 void reset()
          Reset any internal state back to a blank slate.
abstract  void writeBinary(java.nio.ByteBuffer buf)
           
abstract  void writeBool(boolean b)
           
abstract  void writeByte(byte b)
           
abstract  void writeDouble(double dub)
           
abstract  void writeFieldBegin(TField field)
           
abstract  void writeFieldEnd()
           
abstract  void writeFieldStop()
           
abstract  void writeI16(short i16)
           
abstract  void writeI32(int i32)
           
abstract  void writeI64(long i64)
           
abstract  void writeListBegin(TList list)
           
abstract  void writeListEnd()
           
abstract  void writeMapBegin(TMap map)
           
abstract  void writeMapEnd()
           
abstract  void writeMessageBegin(TMessage message)
          Writing methods.
abstract  void writeMessageEnd()
           
abstract  void writeSetBegin(TSet set)
           
abstract  void writeSetEnd()
           
abstract  void writeString(java.lang.String str)
           
abstract  void writeStructBegin(TStruct struct)
           
abstract  void writeStructEnd()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

trans_

protected TTransport trans_
Transport

Constructor Detail

TProtocol

protected TProtocol(TTransport trans)
Constructor

Method Detail

getTransport

public TTransport getTransport()
Transport accessor


writeMessageBegin

public abstract void writeMessageBegin(TMessage message)
                                throws TException
Writing methods.

Throws:
TException

writeMessageEnd

public abstract void writeMessageEnd()
                              throws TException
Throws:
TException

writeStructBegin

public abstract void writeStructBegin(TStruct struct)
                               throws TException
Throws:
TException

writeStructEnd

public abstract void writeStructEnd()
                             throws TException
Throws:
TException

writeFieldBegin

public abstract void writeFieldBegin(TField field)
                              throws TException
Throws:
TException

writeFieldEnd

public abstract void writeFieldEnd()
                            throws TException
Throws:
TException

writeFieldStop

public abstract void writeFieldStop()
                             throws TException
Throws:
TException

writeMapBegin

public abstract void writeMapBegin(TMap map)
                            throws TException
Throws:
TException

writeMapEnd

public abstract void writeMapEnd()
                          throws TException
Throws:
TException

writeListBegin

public abstract void writeListBegin(TList list)
                             throws TException
Throws:
TException

writeListEnd

public abstract void writeListEnd()
                           throws TException
Throws:
TException

writeSetBegin

public abstract void writeSetBegin(TSet set)
                            throws TException
Throws:
TException

writeSetEnd

public abstract void writeSetEnd()
                          throws TException
Throws:
TException

writeBool

public abstract void writeBool(boolean b)
                        throws TException
Throws:
TException

writeByte

public abstract void writeByte(byte b)
                        throws TException
Throws:
TException

writeI16

public abstract void writeI16(short i16)
                       throws TException
Throws:
TException

writeI32

public abstract void writeI32(int i32)
                       throws TException
Throws:
TException

writeI64

public abstract void writeI64(long i64)
                       throws TException
Throws:
TException

writeDouble

public abstract void writeDouble(double dub)
                          throws TException
Throws:
TException

writeString

public abstract void writeString(java.lang.String str)
                          throws TException
Throws:
TException

writeBinary

public abstract void writeBinary(java.nio.ByteBuffer buf)
                          throws TException
Throws:
TException

readMessageBegin

public abstract TMessage readMessageBegin()
                                   throws TException
Reading methods.

Throws:
TException

readMessageEnd

public abstract void readMessageEnd()
                             throws TException
Throws:
TException

readStructBegin

public abstract TStruct readStructBegin()
                                 throws TException
Throws:
TException

readStructEnd

public abstract void readStructEnd()
                            throws TException
Throws:
TException

readFieldBegin

public abstract TField readFieldBegin()
                               throws TException
Throws:
TException

readFieldEnd

public abstract void readFieldEnd()
                           throws TException
Throws:
TException

readMapBegin

public abstract TMap readMapBegin()
                           throws TException
Throws:
TException

readMapEnd

public abstract void readMapEnd()
                         throws TException
Throws:
TException

readListBegin

public abstract TList readListBegin()
                             throws TException
Throws:
TException

readListEnd

public abstract void readListEnd()
                          throws TException
Throws:
TException

readSetBegin

public abstract TSet readSetBegin()
                           throws TException
Throws:
TException

readSetEnd

public abstract void readSetEnd()
                         throws TException
Throws:
TException

readBool

public abstract boolean readBool()
                          throws TException
Throws:
TException

readByte

public abstract byte readByte()
                       throws TException
Throws:
TException

readI16

public abstract short readI16()
                       throws TException
Throws:
TException

readI32

public abstract int readI32()
                     throws TException
Throws:
TException

readI64

public abstract long readI64()
                      throws TException
Throws:
TException

readDouble

public abstract double readDouble()
                           throws TException
Throws:
TException

readString

public abstract java.lang.String readString()
                                     throws TException
Throws:
TException

readBinary

public abstract java.nio.ByteBuffer readBinary()
                                        throws TException
Throws:
TException

reset

public void reset()
Reset any internal state back to a blank slate. This method only needs to be implemented for stateful protocols.


getScheme

public java.lang.Class<? extends IScheme> getScheme()
Scheme accessor