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

public interface RangeBuffer<A> extends BufferLike<A>
  • 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

      Buffer<A> 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

      default RangeBuffer<A> slice(long offset, long length)
      Specified by:
      slice in interface BufferLike<A>