public class SynchronizedDataRange<T extends Range<T>> extends Object implements DataRange, DelegatingRange<T>
SynchronizedRange that indirectly encapsulates DataRange (most probably via delegation chain).| Constructor and Description |
|---|
SynchronizedDataRange(SynchronizedRange<T> delegate,
Function<T,DataRange> converter) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getBytes()
Get all data in this range
|
boolean |
getBytes(ByteBuffer buffer)
Read all data in this range to the provided buffer.
|
T |
getDelegate() |
DataRange |
getSubrange(long offset)
Build a subrange of this data range.
|
DataRange |
getSubrange(long offset,
long length)
Build a subrange of this data range.
|
long |
length() |
void |
putBytes(byte[] block)
Put data at the beginning of this range.
|
void |
putBytes(ByteBufferView buffer)
Put data from the provided buffer at the beginning of this range.
|
void |
visitUnits(DataRangeVisitor visitor)
Traverse the storage units in this data range.
|
public SynchronizedDataRange(SynchronizedRange<T> delegate, Function<T,DataRange> converter)
public void visitUnits(DataRangeVisitor visitor)
DataRangevisitUnits in interface DataRangepublic long length()
public DataRange getSubrange(long offset, long length)
DataRangegetSubrange in interface DataRangegetSubrange in interface Range<DataRange>offset - Offset from the beginning of the original data range in bytes, inclusivelength - Length of the new data rangepublic DataRange getSubrange(long offset)
DataRangegetSubrange in interface DataRangegetSubrange in interface Range<DataRange>offset - Offset from the beginning of the original data range in bytes, inclusivepublic byte[] getBytes()
Rangepublic boolean getBytes(ByteBuffer buffer)
Rangepublic void putBytes(byte[] block)
RangeputBytes in interface Range<DataRange>block - Block of data with length less than or equal to Range.length() of this rangepublic void putBytes(ByteBufferView buffer)
Rangepublic T getDelegate()
getDelegate in interface DelegatingRange<T extends Range<T>>Copyright © 2016–2021. All rights reserved.