Implemented ByteBuffer.clear()

This commit is contained in:
Eric Scharff 2007-10-11 09:59:52 -06:00
parent b59d234b16
commit e831a41e90

View File

@ -27,6 +27,12 @@ public class ByteBuffer {
return array;
}
public ByteBuffer clear() {
position = 0;
limit = capacity;
return this;
}
public ByteBuffer slice() {
ByteBuffer buf = new ByteBuffer(array);
buf.arrayOffset = arrayOffset + position;