(ByteBuffer b)
| 105 | } |
| 106 | |
| 107 | public int write(ByteBuffer b) throws IOException { |
| 108 | if (b.remaining() == 0) return 0; |
| 109 | |
| 110 | byte[] array = b.array(); |
| 111 | if (array == null) throw new NullPointerException(); |
| 112 | |
| 113 | int c = write |
| 114 | (socket, array, b.arrayOffset() + b.position(), b.remaining(), blocking); |
| 115 | |
| 116 | if (c > 0) { |
| 117 | b.position(b.position() + c); |
| 118 | } |
| 119 | |
| 120 | return c; |
| 121 | } |
| 122 | |
| 123 | public int read(ByteBuffer b) throws IOException { |
| 124 | int p = b.position(); |