 		return ret
 	}
 	
-	class func data(BSONObject: [String: Any], options opt: BSONWritingOptions) throws -> Data {
+	class func data(withBSONObject BSONObject: BSONDoc, options opt: BSONWritingOptions) throws -> Data {
 		guard let stream = CFWriteStreamCreateWithAllocatedBuffers(kCFAllocatorDefault, kCFAllocatorDefault) else {
 			throw BSONSerializationError.internalError
 		}

	- Throws: `BSONSerializationError` in case of error.
	- Returns: The serialized BSON data.
	*/
	class func BSONObject(data: Data, options opt: BSONReadingOptions) throws -> [String: Any] {
		guard data.count >= 5 else {
			throw BSONSerializationError.dataTooSmall
		}

				fatalError("Not Implemented")
				
			case .minKey?:
				ret[key] = MinKey()
				
			case .maxKey?:
				ret[key] = MaxKey()
				
			case .undefined?:
				ret[key] = nil
				
			case .dbPointer?:
				let stringPart = try readString(buffer: buffer, bufferStartPos: &posInBuffer, bufferValidLength: &bufferSize, maxBufferSize: maxBufferSize, totalNReadBytes: &totalBytesRead, stream: stream)
				let bytesPartData = try readDataFromBuffer(dataSize: 12, alwaysCopyBytes: true, buffer: buffer, bufferStartPos: &posInBuffer, bufferValidLength: &bufferSize, maxBufferSize: maxBufferSize, totalNReadBytes: &totalBytesRead, stream: stream)
				ret[key] = MongoDBPointer(stringPart: stringPart, bytesPartData: bytesPartData)
				
			case .symbol?:
				ret[key] = try readString(buffer: buffer, bufferStartPos: &posInBuffer, bufferValidLength: &bufferSize, maxBufferSize: maxBufferSize, totalNReadBytes: &totalBytesRead, stream: stream)
