public class Binary
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
Binary(BsonBinarySubType type,
byte[] data)
Creates a Binary with the specified type and data.
|
Binary(byte[] data)
Creates a Binary object with the default binary type of 0
|
Binary(byte type,
byte[] data)
Creates a Binary object
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
byte[] |
getData()
Get a copy of the binary value.
|
byte |
getType()
Get the binary sub type as a byte.
|
int |
hashCode() |
int |
length()
Get the length of the data.
|
public Binary(byte[] data)
data
- raw datapublic Binary(BsonBinarySubType type, byte[] data)
type
- the binary typedata
- the binary datapublic Binary(byte type, byte[] data)
type
- type of the field as encoded in BSONdata
- raw datapublic byte getType()
public byte[] getData()
public int length()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object