Add toString methods to the buffer implementations

This commit is contained in:
Chris Vest 2020-11-20 12:44:09 +01:00
parent 53d2e4b955
commit a4ecc1b184
2 changed files with 10 additions and 0 deletions

View File

@ -115,6 +115,11 @@ final class CompositeBuf extends RcSupport<Buf, CompositeBuf> implements Buf {
capacity = (int) cap;
}
@Override
public String toString() {
return "Buf[roff:" + roff + ", woff:" + woff + ", cap:" + capacity + ']';
}
@Override
public Buf order(ByteOrder order) {
for (Buf buf : bufs) {

View File

@ -78,6 +78,11 @@ class MemSegBuf extends RcSupport<Buf, MemSegBuf> implements Buf {
isBigEndian = ByteOrder.nativeOrder() == ByteOrder.BIG_ENDIAN;
}
@Override
public String toString() {
return "Buf[roff:" + roff + ", woff:" + woff + ", cap:" + seg.byteSize() + ']';
}
@Override
public Buf order(ByteOrder order) {
isBigEndian = order == ByteOrder.BIG_ENDIAN;