Add from and to (1.1.22)
This commit is contained in:
parent
75a9b68ac4
commit
53de22087f
@ -94,6 +94,16 @@ public interface Buf extends ByteList, RandomAccess {
|
||||
*/
|
||||
int getBackingByteArrayLength();
|
||||
|
||||
/**
|
||||
* Unsafe operation, same as Offset
|
||||
*/
|
||||
int getBackingByteArrayFrom();
|
||||
|
||||
/**
|
||||
* Unsafe operation, same as offset + length
|
||||
*/
|
||||
int getBackingByteArrayTo();
|
||||
|
||||
/**
|
||||
* Get this element as an array with equal or bigger size, only if it's already an array, otherwise return null
|
||||
* The returned array may be bigger than expected!
|
||||
|
@ -180,6 +180,16 @@ class ByteListBuf extends ByteArrayList implements Buf {
|
||||
return this.size;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBackingByteArrayFrom() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBackingByteArrayTo() {
|
||||
return this.size;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte @Nullable [] asUnboundedArrayStrict() {
|
||||
return a;
|
||||
@ -417,6 +427,16 @@ class ByteListBuf extends ByteArrayList implements Buf {
|
||||
return this.to - this.from;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBackingByteArrayFrom() {
|
||||
return this.from;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBackingByteArrayTo() {
|
||||
return this.to;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isMutable() {
|
||||
return ByteListBuf.this.isMutable();
|
||||
|
Loading…
x
Reference in New Issue
Block a user