refactor error handler for BufferedProtocolReadToWrite to be non-static

refactor error handler for BufferedProtocolReadToWrite to be non-static