@InterfaceAudience.Public public class SimplePositionedMutableByteRange extends AbstractPositionedByteRange
AbstractPositionedByteRange implementation with
 position support and it is a mutable version. position is considered transient,
 not fundamental to the definition of the range, and does not participate in
 AbstractByteRange.compareTo(ByteRange), AbstractByteRange.hashCode(), or
 Object.equals(Object). Position is retained by copy operations.limit, positionbytes, hash, length, offset, UNSET_HASH_VALUE| Constructor and Description | 
|---|
| SimplePositionedMutableByteRange()Create a new  PositionedByteRangelacking a backing array and with
 an undefined viewport. | 
| SimplePositionedMutableByteRange(byte[] bytes)Create a new  PositionedByteRangeover the providedbytes. | 
| SimplePositionedMutableByteRange(byte[] bytes,
                                int offset,
                                int length)Create a new  PositionedByteRangeover the providedbytes. | 
| SimplePositionedMutableByteRange(int capacity)Create a new  PositionedByteRangeover a new backing array of sizecapacity. | 
| Modifier and Type | Method and Description | 
|---|---|
| PositionedByteRange | deepCopy()Create a new  ByteRangewith new backing byte[] containing a copy
 of the content fromthisrange's window. | 
| PositionedByteRange | get(int index,
   byte[] dst)Fill  dstwith bytes from the range, starting fromindex. | 
| PositionedByteRange | get(int index,
   byte[] dst,
   int offset,
   int length)Fill  dstwith bytes from the range, starting fromindex. | 
| PositionedByteRange | put(byte val)Store  valat the next position in this range. | 
| PositionedByteRange | put(byte[] val)Store the content of  valin this range, starting at the next position. | 
| PositionedByteRange | put(byte[] val,
   int offset,
   int length)Store  lengthbytes fromvalinto this range. | 
| PositionedByteRange | put(int index,
   byte val)Store  valatindex. | 
| PositionedByteRange | put(int index,
   byte[] val)Store  valatindex. | 
| PositionedByteRange | put(int index,
   byte[] val,
   int offset,
   int length)Store  lengthbytes fromvalinto this range, starting atindex. | 
| PositionedByteRange | putInt(int val)Store int  valat the next position in this range. | 
| PositionedByteRange | putInt(int index,
      int val)Store the int value at  index | 
| PositionedByteRange | putLong(int index,
       long val)Store the long value at  index | 
| PositionedByteRange | putLong(long val)Store long  valat the next position in this range. | 
| PositionedByteRange | putShort(int index,
        short val)Store the short value at  index | 
| PositionedByteRange | putShort(short val)Store short  valat the next position in this range. | 
| int | putVLong(int index,
        long val)Store the long value at  indexas a VLong | 
| int | putVLong(long val)Store the long  valat the next position as a VLong | 
| PositionedByteRange | set(byte[] bytes)Reuse this  ByteRangeover a new byte[]. | 
| PositionedByteRange | set(byte[] bytes,
   int offset,
   int length)Reuse this  ByteRangeover a new byte[]. | 
| PositionedByteRange | set(int capacity)Reuse this  ByteRangeover a new byte[]. | 
| PositionedByteRange | setLength(int length)Update the length of this range. | 
| PositionedByteRange | setOffset(int offset)Update the beginning of this range. | 
| PositionedByteRange | shallowCopy()Create a new  ByteRangethat points at this range's byte[]. | 
| PositionedByteRange | shallowCopySubRange(int innerOffset,
                   int copyLength)Create a new  ByteRangethat points at this range's byte[]. | 
| PositionedByteRange | unset()Nullifies this ByteRange. | 
clear, flip, get, get, get, getInt, getLimit, getLong, getPosition, getRemaining, getShort, getVLong, peek, setLimit, setPositionclearHashCache, compareTo, deepCopySubRangeTo, deepCopyTo, deepCopyToNewArray, get, getBytes, getInt, getLength, getLong, getOffset, getShort, getVLong, getVLongSize, hashCode, isEmpty, isEmpty, isHashCached, toStringclone, equals, finalize, getClass, notify, notifyAll, wait, wait, waitdeepCopySubRangeTo, deepCopyTo, deepCopyToNewArray, get, getBytes, getInt, getLength, getLong, getOffset, getShort, getVLong, isEmptycompareTopublic SimplePositionedMutableByteRange()
PositionedByteRange lacking a backing array and with
 an undefined viewport.public SimplePositionedMutableByteRange(int capacity)
PositionedByteRange over a new backing array of size
 capacity. The range's offset and length are 0 and capacity,
 respectively.capacity - the size of the backing array.public SimplePositionedMutableByteRange(byte[] bytes)
PositionedByteRange over the provided bytes.bytes - The array to wrap.public SimplePositionedMutableByteRange(byte[] bytes, int offset, int length)
PositionedByteRange 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 PositionedByteRange unset()
ByteRangeunset in interface ByteRangeunset in interface PositionedByteRangeunset in class AbstractPositionedByteRangepublic PositionedByteRange set(int capacity)
ByteRangeByteRange over a new byte[]. offset is set to
 0 and length is set to capacity.set in interface ByteRangeset in interface PositionedByteRangeset in class AbstractPositionedByteRangecapacity - the size of a new byte[].public PositionedByteRange 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 in interface ByteRangeset in interface PositionedByteRangeset in class AbstractPositionedByteRangebytes - the array to wrap.public PositionedByteRange 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 in interface ByteRangeset in interface PositionedByteRangeset in class AbstractPositionedByteRangebytes - The array to wrap.offset - The offset into bytes considered the beginning of
            this range.length - The length of this range.public PositionedByteRange setOffset(int offset)
offset + length may not be
 greater than bytes.length. Resets position to 0.setOffset in interface ByteRangesetOffset in interface PositionedByteRangesetOffset in class AbstractPositionedByteRangeoffset - the new start of this range.public PositionedByteRange setLength(int length)
offset + length should not be
 greater than bytes.length. If position is greater than the
 new length, sets position to length.setLength in interface ByteRangesetLength in interface PositionedByteRangesetLength in class AbstractPositionedByteRangelength - The new length of this range.public PositionedByteRange put(byte val)
PositionedByteRangeval at the next position in this range.put in interface PositionedByteRangeput in class AbstractPositionedByteRangeval - the new value.public PositionedByteRange put(byte[] val)
PositionedByteRangeval in this range, starting at the next position.put in interface PositionedByteRangeput in class AbstractPositionedByteRangeval - the new value.public PositionedByteRange put(byte[] val, int offset, int length)
PositionedByteRangelength bytes from val into this range. Bytes from
 val are copied starting at offset into the range, starting at
 the current position.put in interface PositionedByteRangeput in class AbstractPositionedByteRangeval - the new value.offset - the offset in val from which to start copying.length - the number of bytes to copy from val.public PositionedByteRange get(int index, byte[] dst)
ByteRangedst with bytes from the range, starting from index.get in interface ByteRangeget in interface PositionedByteRangeget in class AbstractPositionedByteRangeindex - zero-based index into this range.dst - the destination of the copy.public PositionedByteRange get(int index, byte[] dst, int offset, int length)
ByteRangedst with bytes from the range, starting from index.
 length bytes are copied into dst, starting at offset.get in interface ByteRangeget in interface PositionedByteRangeget in class AbstractPositionedByteRangeindex - zero-based index into this range.dst - the destination of the copy.offset - the offset into dst to start the copy.length - the number of bytes to copy into dst.public PositionedByteRange put(int index, byte val)
ByteRangeval at index.put in interface ByteRangeput in interface PositionedByteRangeput in class AbstractPositionedByteRangeindex - the index in the range where val is stored.val - the value to store.public PositionedByteRange put(int index, byte[] val)
ByteRangeval at index.put in interface ByteRangeput in interface PositionedByteRangeput in class AbstractPositionedByteRangeindex - the index in the range where val is stored.val - the value to store.public PositionedByteRange 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 in interface ByteRangeput in interface PositionedByteRangeput in class AbstractPositionedByteRangeindex - 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 PositionedByteRange deepCopy()
ByteRangeByteRange with new backing byte[] containing a copy
 of the content from this range's window.deepCopy in interface ByteRangedeepCopy in interface PositionedByteRangedeepCopy in class AbstractPositionedByteRangepublic PositionedByteRange 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.shallowCopy in interface ByteRangeshallowCopy in interface PositionedByteRangeshallowCopy in class AbstractPositionedByteRangeByteRange object referencing this range's byte[].public PositionedByteRange 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.shallowCopySubRange in interface ByteRangeshallowCopySubRange in interface PositionedByteRangeshallowCopySubRange in class AbstractPositionedByteRangeinnerOffset - First byte of clone will be this.offset + copyOffset.copyLength - Number of bytes in the clone.ByteRange object referencing this range's byte[].public PositionedByteRange putShort(short val)
PositionedByteRangeval at the next position in this range.putShort in interface PositionedByteRangeputShort in class AbstractPositionedByteRangeval - the new value.public PositionedByteRange putInt(int val)
PositionedByteRangeval at the next position in this range.putInt in interface PositionedByteRangeputInt in class AbstractPositionedByteRangeval - the new value.public PositionedByteRange putLong(long val)
PositionedByteRangeval at the next position in this range.putLong in interface PositionedByteRangeputLong in class AbstractPositionedByteRangeval - the new value.public int putVLong(long val)
PositionedByteRangeval at the next position as a VLongputVLong in interface PositionedByteRangeputVLong in class AbstractPositionedByteRangeval - the value to storepublic PositionedByteRange putShort(int index, short val)
ByteRangeindexputShort in interface ByteRangeputShort in interface PositionedByteRangeputShort in class AbstractPositionedByteRangeindex - the index in the range where val is storedval - the value to storepublic PositionedByteRange putInt(int index, int val)
ByteRangeindexputInt in interface ByteRangeputInt in interface PositionedByteRangeputInt in class AbstractPositionedByteRangeindex - the index in the range where val is storedval - the value to storepublic PositionedByteRange putLong(int index, long val)
ByteRangeindexputLong in interface ByteRangeputLong in interface PositionedByteRangeputLong in class AbstractPositionedByteRangeindex - the index in the range where val is storedval - the value to storepublic int putVLong(int index, long val)
ByteRangeindex as a VLongputVLong in interface ByteRangeputVLong in class AbstractPositionedByteRangeindex - the index in the range where val is storedval - the value to storeCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.