@InterfaceAudience.Public @InterfaceStability.Evolving public class SimpleByteRange extends AbstractByteRange
ByteRange.bytes, hash, length, offset, UNSET_HASH_VALUE| 构造器和说明 |
|---|
SimpleByteRange() |
SimpleByteRange(byte[] bytes)
Create a new
ByteRange over the provided bytes. |
SimpleByteRange(byte[] bytes,
int offset,
int length)
Create a new
ByteRange over the provided bytes. |
SimpleByteRange(int capacity) |
| 限定符和类型 | 方法和说明 |
|---|---|
ByteRange |
deepCopy()
Create a new
ByteRange with new backing byte[] containing a copy
of the content from this range's window. |
boolean |
equals(Object thatObject) |
ByteRange |
put(int index,
byte val)
Store
val at index. |
ByteRange |
put(int index,
byte[] val)
Store
val at index. |
ByteRange |
put(int index,
byte[] val,
int offset,
int length)
Store
length bytes from val into this range, starting at
index. |
ByteRange |
putInt(int index,
int val)
Store the int value at
index |
ByteRange |
putLong(int index,
long val)
Store the long value at
index |
ByteRange |
putShort(int index,
short val)
Store the short value at
index |
int |
putVLong(int index,
long val)
Store the long value at
index as a VLong |
ByteRange |
set(byte[] bytes)
Reuse this
ByteRange over a new byte[]. |
ByteRange |
set(byte[] bytes,
int offset,
int length)
Reuse this
ByteRange over a new byte[]. |
ByteRange |
set(int capacity)
Reuse this
ByteRange over a new byte[]. |
ByteRange |
shallowCopy()
Create a new
ByteRange that points at this range's byte[]. |
ByteRange |
shallowCopySubRange(int innerOffset,
int copyLength)
Create a new
ByteRange that points at this range's byte[]. |
ByteRange |
unset()
Nullifies this ByteRange.
|
clearHashCache, compareTo, deepCopySubRangeTo, deepCopyTo, deepCopyToNewArray, get, get, get, getBytes, getInt, getLength, getLong, getOffset, getShort, getVLong, getVLongSize, hashCode, isEmpty, isEmpty, isHashCached, setLength, setOffset, toStringpublic SimpleByteRange()
public SimpleByteRange(int capacity)
public SimpleByteRange(byte[] bytes)
ByteRange over the provided bytes.bytes - The array to wrap.public SimpleByteRange(byte[] bytes,
int offset,
int length)
ByteRange over the provided bytes.bytes - The array to wrap.offset - The offset into bytes considered the beginning
of this range.length - The length of this range.public ByteRange unset()
ByteRangeunset 在接口中 ByteRangeunset 在类中 AbstractByteRangepublic ByteRange set(int capacity)
ByteRangeByteRange over a new byte[]. offset is set to
0 and length is set to capacity.set 在接口中 ByteRangeset 在类中 AbstractByteRangecapacity - the size of a new byte[].public ByteRange set(byte[] bytes)
ByteRangeByteRange over a new byte[]. offset is set to
0 and length is set to bytes.length. A null bytes
IS supported, in which case this method will behave equivalently to
ByteRange.unset().set 在接口中 ByteRangeset 在类中 AbstractByteRangebytes - the array to wrap.public ByteRange set(byte[] bytes, int offset, int length)
ByteRangeByteRange over a new byte[]. A null bytes IS
supported, in which case this method will behave equivalently to
ByteRange.unset(), regardless of the values of offset and
length.set 在接口中 ByteRangeset 在类中 AbstractByteRangebytes - The array to wrap.offset - The offset into bytes considered the beginning of
this range.length - The length of this range.public ByteRange put(int index, byte val)
ByteRangeval at index.put 在接口中 ByteRangeput 在类中 AbstractByteRangeindex - the index in the range where val is stored.val - the value to store.public ByteRange put(int index, byte[] val)
ByteRangeval at index.put 在接口中 ByteRangeput 在类中 AbstractByteRangeindex - the index in the range where val is stored.val - the value to store.public ByteRange put(int index, byte[] val, int offset, int length)
ByteRangelength bytes from val into this range, starting at
index. Bytes from val are copied starting at offset
into the range.put 在接口中 ByteRangeput 在类中 AbstractByteRangeindex - position in this range to start the copy.val - the value to store.offset - the offset in val from which to start copying.length - the number of bytes to copy from val.public ByteRange shallowCopy()
ByteRangeByteRange that points at this range's byte[].
Modifying the shallowCopy will modify the bytes in this range's array.
Pass over the hash code if it is already cached.ByteRange object referencing this range's byte[].public ByteRange shallowCopySubRange(int innerOffset, int copyLength)
ByteRangeByteRange that points at this range's byte[]. The new
range can have different values for offset and length, but modifying the
shallowCopy will modify the bytes in this range's array. Pass over the
hash code if it is already cached.innerOffset - First byte of clone will be this.offset + copyOffset.copyLength - Number of bytes in the clone.ByteRange object referencing this range's byte[].public ByteRange deepCopy()
ByteRangeByteRange with new backing byte[] containing a copy
of the content from this range's window.public ByteRange putInt(int index, int val)
ByteRangeindexputInt 在接口中 ByteRangeputInt 在类中 AbstractByteRangeindex - the index in the range where val is storedval - the value to storepublic ByteRange putLong(int index, long val)
ByteRangeindexputLong 在接口中 ByteRangeputLong 在类中 AbstractByteRangeindex - the index in the range where val is storedval - the value to storepublic ByteRange putShort(int index, short val)
ByteRangeindexputShort 在接口中 ByteRangeputShort 在类中 AbstractByteRangeindex - the index in the range where val is storedval - the value to storepublic int putVLong(int index,
long val)
ByteRangeindex as a VLongputVLong 在接口中 ByteRangeputVLong 在类中 AbstractByteRangeindex - the index in the range where val is storedval - the value to storeCopyright © 2007–2021 The Apache Software Foundation. All rights reserved.