(SocketChannel channel, ByteBuffer buffer)
| 263 | } |
| 264 | |
| 265 | private void readFully(SocketChannel channel, ByteBuffer buffer) throws IOException { |
| 266 | while (buffer.hasRemaining()) { |
| 267 | if (channel.read(buffer) == -1) { |
| 268 | throw new IOException("连接已关闭"); |
| 269 | } |
| 270 | } |
| 271 | } |
| 272 | |
| 273 | private void writeFully(SocketChannel channel, ByteBuffer buffer) throws IOException { |
| 274 | while (buffer.hasRemaining()) { |
no test coverage detected