Binary
Date: 2015-03-03

org.bson.types

## Class Binary

- java.lang.Object
- - org.bson.types.Binary

- All Implemented Interfaces:
    java.io.Serializable

      public class Binary
      extends java.lang.Object
      implements java.io.Serializable

  generic binary holder
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Binary(byte[] data)` Creates a Binary object with the default binary type of 0
    `Binary(byte type, byte[] data)` Creates a Binary object

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(java.lang.Object o)`
    `byte[]` | `getData()`
    `byte` | `getType()`
    `int` | `hashCode()`
    `int` | `length()`

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

      `getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Binary

          public Binary(byte[] data)

      Creates a Binary object with the default binary type of 0
      Parameters:
        `data` - raw data

    - #### Binary

          public Binary(byte type,
                byte[] data)

      Creates a Binary object
      Parameters:
        `type` - type of the field as encoded in BSON
        `data` - raw data

  - ### Method Detail

    - #### getType

          public byte getType()

    - #### getData

          public byte[] getData()

    - #### length

          public int length()

    - #### equals

          public boolean equals(java.lang.Object o)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`