converting streams to blocks of strings and vice-versa

I have developed a java/scala XMPP client app that sends data asynchronously using (say) a `write` method and receives data using a `listener` method. The `listener` method receives data as discrete XMPP message packets and processes them using a `processPacket` method (which I can modify based on what I want to do with the received data) I want to hook up a 3rd party library that reads data from an `inputstream` and writes to an `outputstream`. Specifically, I want the `inputstream` of the 3rd party library to be emulated using the data received via my `listener` method and the `outputstream` to be emulated by my `write` method. What would be the easiest way to do this? I know that this requires conversion from a stream to chunks of strings and vice-versa. Some hints would be appreciated. The XMPP message packet structure is as follows (though this can be changed if needed): data
Have you looked at Scala IO?

以上就是converting streams to blocks of strings and vice-versa的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准