com.mongodb
Class ByteDecoder

java.lang.Object
  extended by com.mongodb.Bytes
      extended by com.mongodb.ByteDecoder

public class ByteDecoder
extends Bytes

Deserializes a string from the database into a DBObject.


Field Summary
 
Fields inherited from class com.mongodb.Bytes
_utf8, MAX_STRING, ORDER, QUERYOPTION_NOTIMEOUT, QUERYOPTION_OPLOGREPLAY, QUERYOPTION_SLAVEOK, QUERYOPTION_TAILABLE
 
Constructor Summary
ByteDecoder(ByteBuffer buf)
           
 
Method Summary
protected  int decodeNext(DBObject o, String path)
          Decodes the serialized object into the given DBObject.
protected  void done()
          Returns this decoder to the pool.
protected static ByteDecoder get(DB base, DBCollection coll)
          Gets a new ByteDecoder from the pool.
 DBObject readObject()
          Decode an object.
 void reset(ByteBuffer buf)
          Returns this decoder to its starting state with a new ByteBuffer to decode.
 
Methods inherited from class com.mongodb.Bytes
addDecodingHook, addEncodingHook, applyDecodingHooks, applyEncodingHooks, clearAllHooks, decode, encode, getFlag, getType, patternFlags, patternFlags
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteDecoder

public ByteDecoder(ByteBuffer buf)
Method Detail

get

protected static ByteDecoder get(DB base,
                                 DBCollection coll)
Gets a new ByteDecoder from the pool.

Parameters:
base - the database
coll - the collection
Returns:
the new ByteDecoder

done

protected void done()
Returns this decoder to the pool.


reset

public void reset(ByteBuffer buf)
Returns this decoder to its starting state with a new ByteBuffer to decode.

Parameters:
buf - new ByteBuffer

readObject

public DBObject readObject()
Decode an object.

Returns:
the decoded object

decodeNext

protected int decodeNext(DBObject o,
                         String path)
Decodes the serialized object into the given DBObject.

Parameters:
o - object to which to add fields
Returns:
the number of characters decoded