【发布时间】:2013-08-27 09:05:36
【问题描述】:
这就是我的意思:
put 512 bytes
SocketChannel#write(this data)
start at the beginning and put 512 bytes again
rinse & repeat
我仍在尝试掌握 ByteBuffers,并且我尝试过使用 ByteBuffer#reset(),但我总是收到 InvalidMarkException,即使这似乎是正确的解决方案(除非我错了,我不会感到惊讶! )
谢谢!
编辑:具体来说,我正在尝试实现同样的效果,除了我想以 512 字节的块而不是批量发送它。 http://privatepaste.com/1fb0e6df07
【问题讨论】:
标签: java nio bytebuffer