Class PagedBytes.Reader

  • Enclosing class:
    PagedBytes

    public static final class PagedBytes.Reader
    extends java.lang.Object
    Provides methods to read BytesRefs from a frozen PagedBytes.
    See Also:
    PagedBytes.freeze(boolean)
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void fill​(BytesRef b, long start)
      Reads length as 1 or 2 byte vInt prefix, starting at start.
      void fillSlice​(BytesRef b, long start, int length)
      Gets a slice out of PagedBytes starting at start with a given length.
      long ramBytesUsed()
      Returns approximate RAM bytes used
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • fillSlice

        public void fillSlice​(BytesRef b,
                              long start,
                              int length)
        Gets a slice out of PagedBytes starting at start with a given length. Iff the slice spans across a block border this method will allocate sufficient resources and copy the paged data.

        Slices spanning more than two blocks are not supported.

      • fill

        public void fill​(BytesRef b,
                         long start)
        Reads length as 1 or 2 byte vInt prefix, starting at start.

        Note: this method does not support slices spanning across block borders.

      • ramBytesUsed

        public long ramBytesUsed()
        Returns approximate RAM bytes used