Serializable
public class Binary extends Object implements Serializable
Constructor | Description |
---|---|
Binary(byte[] data) |
Creates a Binary object with the default binary type of 0
|
Binary(byte type,
byte[] data) |
Creates a Binary object
|
Binary(BsonBinarySubType type,
byte[] data) |
Creates a Binary with the specified type and data.
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
equals(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()