()
| 32 | } |
| 33 | |
| 34 | public ByteBuffer asReadOnlyBuffer() { |
| 35 | ByteBuffer b = new DirectByteBuffer(address, capacity, true); |
| 36 | b.position(position()); |
| 37 | b.limit(limit()); |
| 38 | return b; |
| 39 | } |
| 40 | |
| 41 | public ByteBuffer slice() { |
| 42 | return new DirectByteBuffer(address + position, remaining(), true); |