                         break
                     }
 
-                    let bytesToRead = min(LightMQTT.BUFFER_SIZE - byteCount, messageLength - byteCount)
+                    let bytesToRead = min(options.bufferSize - byteCount, messageLength - byteCount)
                     let count = inputStream.read(messageBuffer.advanced(by: byteCount), maxLength: bytesToRead)
                     if count == 0 {
                         break

    private var outputStream: OutputStream?

    private var messageId: UInt16 = 0

    private static let BUFFER_SIZE: Int = 4096

    init(host: String, options: Options = Options()) {
        self.host = host

    }

    func connect() -> Bool {
        if inputStream != nil || outputStream != nil {
            return false
        }
