You can add fourth attribute WriteMode.NonBlocking in the Writemethod.
By the way, when you execute the write method, you can do it inHandlerThread.
As Note: please don't make a screenshot about your code, you can copy your code here directly.