 		guard bufferSize > 0 else {throw BSONSerializationError.earlyStreamEnding}
 		totalBytesRead += bufferSize
 		
-		var ret = [String: AnyObject]()
+		var ret = [String: Any]()
 		
 		var isAtEnd = false
 		while !isAtEnd {

					let oldBufferSize = newMaxBufferSize
					
					newMaxBufferSize += min(newMaxBufferSize, 4*1024 /* 4KB */)
					newBuffer = UnsafeMutablePointer<UInt8>(allocatingCapacity: newMaxBufferSize)
//					if newBuffer == nil {throw BSONSerializationError.cannotAllocateMemory(newMaxBufferSize)}
					newBuffer.assignFrom(oldBuffer, count: newBufferValidLength)
					newBufferStart = newBuffer; newBufferEnd = newBufferStart.advanced(by: newBufferValidLength)
					
					if oldBuffer != buffer {oldBuffer.deallocateCapacity(oldBufferSize)}
				}
			}
			

		return ret
	}
	
	class func data(BSONObject: Any, options opt: BSONWritingOptions) throws -> Data {
		return Data()
	}
	
	class func write(BSONObject: Any, toStream stream: OutputStream, options opt: BSONWritingOptions, error: NSErrorPointer) -> Int {
		return 0
	}
	
	class func isValidBSONObject(_ obj: Any) -> Bool {
		return false
	}
	
