Interface RangeBuffer<A>
- All Superinterfaces:
ArrayReadable<A>, ArrayWritable<A>, BufferLike<A>, HasArrayOps<A>, ReadableChannelFactory<A>, ReadableChannelSource<A>, SeekableReadableChannelSource<A>
- All Known Subinterfaces:
RangeBufferDelegate<A>, RangeBufferDelegateMutable<A>
- All Known Implementing Classes:
RangeBufferDelegateBase, RangeBufferDelegateMutableImpl, RangeBufferImpl, RangeBufferUnion
-
Method Summary
Modifier and TypeMethodDescriptioncom.google.common.collect.RangeSet<Long> getCoveredRanges(com.google.common.collect.Range<Long> localRange) Return a set of contributions by this buffer for the given lookup range While this method does not expose which parts of the global range are covered, this method allows to check whether there are any gaps in the readThe offset within the range set where this buffer starts; may be null if the offset cannot be represented in a single value such as in a union of two buffers which have different offsetscom.google.common.collect.RangeSet<Long> A set of ranges from which reading is valid.default RangeBuffer<A> slice(long offset, long length) static <A> voidtransfer(RangeBuffer<A> src, long srcOffset, RangeBuffer<A> tgt, long tgtOffset, long length) default voidtransferFrom(long thisOffset, RangeBuffer<A> other, long otherOffset, long length) default voidtransferTo(long thisOffset, RangeBuffer<A> other, long otherOffset, long length) Methods inherited from interface ArrayReadable
get, newReadableChannel, readInto, readIntoRaw, sizeMethods inherited from interface ArrayWritable
put, write, write, writeMethods inherited from interface BufferLike
getCapacityMethods inherited from interface HasArrayOps
getArrayOpsMethods inherited from interface SeekableReadableChannelSource
newReadableChannel, newReadableChannel, newReadableChannel
-
Method Details
-
getRanges
com.google.common.collect.RangeSet<Long> getRanges()A set of ranges from which reading is valid. The range set may be shared among several range buffers and may thus include ranges outside of the range formed by the buffer's offset and capacity -
getOffsetInRanges
Long getOffsetInRanges()The offset within the range set where this buffer starts; may be null if the offset cannot be represented in a single value such as in a union of two buffers which have different offsets -
getBackingBuffer
-
getCoveredRanges
com.google.common.collect.RangeSet<Long> getCoveredRanges(com.google.common.collect.Range<Long> localRange) Return a set of contributions by this buffer for the given lookup range While this method does not expose which parts of the global range are covered, this method allows to check whether there are any gaps in the read -
transferFrom
default void transferFrom(long thisOffset, RangeBuffer<A> other, long otherOffset, long length) throws IOException - Throws:
IOException
-
transferTo
default void transferTo(long thisOffset, RangeBuffer<A> other, long otherOffset, long length) throws IOException - Throws:
IOException
-
transfer
static <A> void transfer(RangeBuffer<A> src, long srcOffset, RangeBuffer<A> tgt, long tgtOffset, long length) throws IOException - Throws:
IOException
-
slice
- Specified by:
slicein interfaceBufferLike<A>
-