org.bson.io
Class OutputBuffer

java.lang.Object
  extended by org.bson.io.OutputBuffer
Direct Known Subclasses:
BasicOutputBuffer, PoolOutputBuffer

public abstract class OutputBuffer
extends java.lang.Object


Constructor Summary
OutputBuffer()
           
 
Method Summary
 java.lang.String asString()
           
 java.lang.String asString(java.lang.String encoding)
           
abstract  int getPosition()
           
 java.lang.String hex()
           
 java.lang.String md5()
           
abstract  int pipe(java.io.OutputStream out)
           
abstract  void seekEnd()
           
abstract  void seekStart()
           
abstract  void setPosition(int position)
           
abstract  int size()
           
 byte[] toByteArray()
          mostly for testing
 java.lang.String toString()
           
abstract  void write(byte[] b)
           
abstract  void write(byte[] b, int off, int len)
           
abstract  void write(int b)
           
 void writeDouble(double x)
           
 void writeInt(int x)
           
 void writeInt(int pos, int x)
           
 void writeLong(long x)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OutputBuffer

public OutputBuffer()
Method Detail

write

public abstract void write(byte[] b)

write

public abstract void write(byte[] b,
                           int off,
                           int len)

write

public abstract void write(int b)

getPosition

public abstract int getPosition()

setPosition

public abstract void setPosition(int position)

seekEnd

public abstract void seekEnd()

seekStart

public abstract void seekStart()

size

public abstract int size()
Returns:
size of data so far

pipe

public abstract int pipe(java.io.OutputStream out)
                  throws java.io.IOException
Returns:
bytes written
Throws:
java.io.IOException

toByteArray

public byte[] toByteArray()
mostly for testing


asString

public java.lang.String asString()

asString

public java.lang.String asString(java.lang.String encoding)
                          throws java.io.UnsupportedEncodingException
Throws:
java.io.UnsupportedEncodingException

hex

public java.lang.String hex()

md5

public java.lang.String md5()

writeInt

public void writeInt(int x)

writeInt

public void writeInt(int pos,
                     int x)

writeLong

public void writeLong(long x)

writeDouble

public void writeDouble(double x)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object