BasicOutputBuffer
Date: 2015-03-03

org.bson.io

## Class BasicOutputBuffer

- java.lang.Object
- - java.io.OutputStream
  - - org.bson.io.OutputBuffer
    - - org.bson.io.BasicOutputBuffer

- All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable

      public class BasicOutputBuffer
      extends OutputBuffer

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BasicOutputBuffer()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `asString()`
    `java.lang.String` | `asString(java.lang.String encoding)`
    `int` | `getPosition()`
    `int` | `pipe(java.io.DataOutput out)`
    `int` | `pipe(java.io.OutputStream out)`
    `void` | `seekEnd()`
    `void` | `seekStart()`
    `void` | `setPosition(int position)`
    `int` | `size()`
    `void` | `write(byte[] b)`
    `void` | `write(byte[] b, int off, int len)`
    `void` | `write(int b)`

    - ### Methods inherited from class org.bson.io.OutputBuffer

      `hex, md5, toByteArray, toString, writeDouble, writeInt, writeInt, writeIntBE, writeLong`

    - ### Methods inherited from class java.io.OutputStream

      `close, flush`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### BasicOutputBuffer

          public BasicOutputBuffer()

  - ### Method Detail

    - #### write

          public void write(byte[] b)

      Specified by:
        `write` in class `OutputBuffer`

    - #### write

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

      Specified by:
        `write` in class `OutputBuffer`

    - #### write

          public void write(int b)

      Specified by:
        `write` in class `OutputBuffer`

    - #### getPosition

          public int getPosition()

      Specified by:
        `getPosition` in class `OutputBuffer`

    - #### setPosition

          public void setPosition(int position)

      Specified by:
        `setPosition` in class `OutputBuffer`

    - #### seekEnd

          public void seekEnd()

      Specified by:
        `seekEnd` in class `OutputBuffer`

    - #### seekStart

          public void seekStart()

      Specified by:
        `seekStart` in class `OutputBuffer`

    - #### size

          public int size()

      Specified by:
        `size` in class `OutputBuffer`
      Returns:
        size of data so far

    - #### pipe

          public int pipe(java.io.OutputStream out)
                   throws java.io.IOException

      Specified by:
        `pipe` in class `OutputBuffer`
      Returns:
        bytes written
      Throws:
        `java.io.IOException`

    - #### pipe

          public int pipe(java.io.DataOutput out)
                   throws java.io.IOException

      Returns:
        bytes written
      Throws:
        `java.io.IOException`

    - #### asString

          public java.lang.String asString()

      Overrides:
        `asString` in class `OutputBuffer`

    - #### asString

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

      Overrides:
        `asString` in class `OutputBuffer`
      Throws:
        `java.io.UnsupportedEncodingException`