# La clase MongoDB\BSON\Binary

(mongodb >=1.0.0)

## Introducción

## Sinopsis de la Clase

class MongoDB\BSON\Binary implements MongoDB\BSON\Type {
/* Constantes */
const integer TYPE_GENERIC = 0;
const integer TYPE_FUNCTION = 1;
const integer TYPE_OLD_BINARY = 2;
const integer TYPE_OLD_UUID = 3;
const integer TYPE_UUID = 4;
const integer TYPE_MD5 = 5;
const integer TYPE_USER_DEFINED = 128;
/* Métodos */
final public __construct(string `$data`, int `$type` = MongoDB\BSON\Binary::TYPE_GENERIC)
final public getData(): string
final public getType(): int
final public jsonSerialize(): mixed
final public serialize(): string
final public __toString(): string
final public unserialize(string `$data`): void
}

## Constantes predefinidas

`MongoDB\BSON\Binary::TYPE_GENERIC`

`MongoDB\BSON\Binary::TYPE_FUNCTION`

`MongoDB\BSON\Binary::TYPE_OLD_BINARY`

`MongoDB\BSON\Binary::TYPE_OLD_UUID`

`MongoDB\BSON\Binary::TYPE_UUID`

`MongoDB\BSON\Binary::TYPE_MD5`

`MongoDB\BSON\Binary::TYPE_USER_DEFINED`

## Tabla de contenidos

- MongoDB\BSON\Binary::__construct — Construct a new Binary
- MongoDB\BSON\Binary::getData — Returns the Binary's data
- MongoDB\BSON\Binary::getType — Returns the Binary's type
- MongoDB\BSON\Binary::jsonSerialize — Returns a representation that can be converted to JSON
- MongoDB\BSON\Binary::serialize — Serialize a Binary
- MongoDB\BSON\Binary::__toString — Returns the Binary's data
- MongoDB\BSON\Binary::unserialize — Unserialize a Binary