code: public void writeBinary(Base64Variant b64variant, byte subType,
  			byte[] data, int offset, int len) throws IOException {
  		//base64 is not needed for BSON
  		_writeArrayFieldNameIfNeeded();
  		_verifyValueWrite("write binary");
  		_buffer.putByte(_typeMarker, BsonConstants.TYPE_BINARY);
  		_buffer.putInt(len);
  		_buffer.putByte(subType);
  		int end = offset + len;
  		if (end > data.length) {
  			end = data.length;
  		}
  		while (offset < end) {
  			_buffer.putByte(data[offset]);
  			++offset;
  		}
  		flushBuffer();
  	}
docs: Similar to {@link #writeBinary(Base64Variant, byte, byte[], int, int)},
  but with the possibility to specify a binary subtype (see
  {@link BsonConstants}).
  @param b64variant base64 variant to use (will be ignored for BSON)
  @param subType the binary subtype
  @param data the binary data to write
  @param offset the offset of the first byte to write
  @param len the number of bytes to write
  @throws IOException if the binary data could not be written