org.infinispan.schematic.internal.document

## Class BsonWriter

- java.lang.Object
- - org.infinispan.schematic.internal.document.BsonWriter

-     @ThreadSafe
      public class BsonWriter
      extends Object

  A component that writes BSON representations from the in-memory `Document` representation.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BsonWriter()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `byte[]` | `write(Object object)` Return the array of bytes containing the standard BSON binary form of the supplied in-memory `Document`.
    `void` | `write(Object object, DataOutput output)` Write to the supplied output the binary BSON representation of the supplied in-memory `Document`.
    `void` | `write(Object object, OutputStream stream)` Write the supplied in-memory `Document` in standard BSON binary format to the supplied stream.
    `protected void` | `write(String name, Binary value, BsonDataOutput output)`
    `protected void` | `write(String name, boolean value, BsonDataOutput output)`
    `protected void` | `write(String name, Code value, BsonDataOutput output)`
    `protected void` | `write(String name, CodeWithScope value, BsonDataOutput output)`
    `protected void` | `write(String name, Date value, BsonDataOutput output)`
    `protected void` | `write(String name, Document document, BsonDataOutput output)`
    `protected void` | `write(String name, double value, BsonDataOutput output)`
    `protected void` | `write(String name, float value, BsonDataOutput output)`
    `protected void` | `write(String name, int value, BsonDataOutput output)`
    `protected void` | `write(String name, Iterable<?> arrayValue, BsonDataOutput output)`
    `protected void` | `write(String name, long value, BsonDataOutput output)`
    `protected void` | `write(String name, MaxKey value, BsonDataOutput output)`
    `protected void` | `write(String name, MinKey value, BsonDataOutput output)`
    `protected void` | `write(String name, Object object, BsonDataOutput output)`
    `protected void` | `write(String name, ObjectId value, BsonDataOutput output)`
    `protected void` | `write(String name, Pattern value, BsonDataOutput output)`
    `protected void` | `write(String name, String value, BsonDataOutput output)`
    `protected void` | `write(String name, Symbol value, BsonDataOutput output)`
    `protected void` | `write(String name, Timestamp value, BsonDataOutput output)`
    `protected void` | `write(String name, UUID value, BsonDataOutput output)`
    `protected void` | `writeArray(String name, Object arrayValue, BsonDataOutput output)`
    `protected void` | `writeCString(String value, BsonDataOutput output)`
    `protected void` | `writeNull(String name, BsonDataOutput output)`
    `protected void` | `writeString(String value, BsonDataOutput output)`

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### BsonWriter

          public BsonWriter()

  - ### Method Detail

    - #### write

          public void write(Object object,
                   OutputStream stream)
                     throws IOException

      Write the supplied in-memory `Document` in standard BSON binary format to the supplied stream.
      Parameters:
        `object` - the BSON object or BSON value; may not be null
        `stream` - the output stream; may not be null
      Throws:
        `IOException` - if there was a problem reading from the stream

    - #### write

          public byte[] write(Object object)
                       throws IOException

      Return the array of bytes containing the standard BSON binary form of the supplied in-memory `Document`.
      Parameters:
        `object` - the BSON object or BSON value; may not be null
      Returns:
        the bytes
      Throws:
        `IOException` - if there was a problem reading from the stream

    - #### write

          public void write(Object object,
                   DataOutput output)
                     throws IOException

      Write to the supplied output the binary BSON representation of the supplied in-memory `Document`.
      Parameters:
        `object` - the BSON object or BSON value; may not be null
        `output` - the output; may not be null
      Throws:
        `IOException` - if there was a problem writing to the ObjectOutput

    - #### write

          protected void write(String name,
                   Object object,
                   BsonDataOutput output)

    - #### writeCString

          protected void writeCString(String value,
                          BsonDataOutput output)

    - #### writeString

          protected void writeString(String value,
                         BsonDataOutput output)

    - #### writeNull

          protected void writeNull(String name,
                       BsonDataOutput output)

    - #### write

          protected void write(String name,
                   String value,
                   BsonDataOutput output)

    - #### write

          protected void write(String name,
                   boolean value,
                   BsonDataOutput output)

    - #### write

          protected void write(String name,
                   int value,
                   BsonDataOutput output)

    - #### write

          protected void write(String name,
                   long value,
                   BsonDataOutput output)

    - #### write

          protected void write(String name,
                   float value,
                   BsonDataOutput output)

    - #### write

          protected void write(String name,
                   double value,
                   BsonDataOutput output)

    - #### writeArray

          protected void writeArray(String name,
                        Object arrayValue,
                        BsonDataOutput output)

    - #### write

          protected void write(String name,
                   Iterable<?> arrayValue,
                   BsonDataOutput output)

    - #### write

          protected void write(String name,
                   Document document,
                   BsonDataOutput output)

    - #### write

          protected void write(String name,
                   Binary value,
                   BsonDataOutput output)

    - #### write

          protected void write(String name,
                   Symbol value,
                   BsonDataOutput output)

    - #### write

          protected void write(String name,
                   Pattern value,
                   BsonDataOutput output)

    - #### write

          protected void write(String name,
                   Date value,
                   BsonDataOutput output)

    - #### write

          protected void write(String name,
                   UUID value,
                   BsonDataOutput output)

    - #### write

          protected void write(String name,
                   CodeWithScope value,
                   BsonDataOutput output)

    - #### write

          protected void write(String name,
                   Code value,
                   BsonDataOutput output)

    - #### write

          protected void write(String name,
                   Timestamp value,
                   BsonDataOutput output)

    - #### write

          protected void write(String name,
                   ObjectId value,
                   BsonDataOutput output)

    - #### write

          protected void write(String name,
                   MaxKey value,
                   BsonDataOutput output)

    - #### write

          protected void write(String name,
                   MinKey value,
                   BsonDataOutput output)

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.