@Test
public void testWriteBinary() {
writer.writeStartDocument();
writer.writeBinaryData("b1", new Binary(new byte[]{0, 0, 0, 0, 0, 0, 0, 0}));
writer.writeBinaryData("b2", new Binary(BSONBinarySubType.OldBinary.getValue(), new byte[]{1, 1, 1, 1, 1}));
writer.writeBinaryData("b3", new Binary(BSONBinarySubType.Function.getValue(), new byte[]{}));
writer.writeEndDocument();
final byte[] expectedValues = {49, 0, 0, 0, 5, 98, 49, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 98, 50, 0,
9, 0,