要执行反序列化,我需要一个ObjectInputStream
。但我们只是使用AsynchronousSocketChannel
,它无法转换为ObjectInputStream
。我能做什么?
最佳答案
您可以通过Channels.newInputStream(channel)
将AsynchronousSocketChannel
转换为InputStream
。
关于java - 如何从 AsynchronousSocketChannel 反序列化可序列化对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13390694/