(ByteBuffer b)
| 119 | } |
| 120 | |
| 121 | public int write(ByteBuffer b) throws IOException { |
| 122 | if (! connected) { |
| 123 | natThrowWriteError(socket); |
| 124 | } |
| 125 | if (b.remaining() == 0) return 0; |
| 126 | |
| 127 | byte[] array = b.array(); |
| 128 | if (array == null) throw new NullPointerException(); |
| 129 | |
| 130 | int w = natWrite(socket, array, b.arrayOffset() + b.position(), b.remaining(), blocking); |
| 131 | if (w > 0) { |
| 132 | b.position(b.position() + w); |
| 133 | } |
| 134 | return w; |
| 135 | } |
| 136 | |
| 137 | public long write(ByteBuffer[] srcs) throws IOException { |
| 138 | return write(srcs, 0, srcs.length); |
no test coverage detected