Class RingBufferForBytes

java.lang.Object
org.aksw.commons.io.buffer.ring.RingBufferBase<byte[]>
org.aksw.commons.io.buffer.ring.RingBufferForBytes
All Implemented Interfaces:
HasArrayOps<byte[]>, ReadableSource<byte[]>

public class RingBufferForBytes extends RingBufferBase<byte[]>
Adapter of RingBufferBase for bytes.
  • Constructor Details

    • RingBufferForBytes

      public RingBufferForBytes(int size)
    • RingBufferForBytes

      protected RingBufferForBytes(byte[] data, int start, int end, boolean isEmpty)
  • Method Details

    • get

      public byte get(int offset)
    • read

      public int read(ByteBuffer out)
    • skip

      public RingBufferForBytes skip(int length)
      Description copied from class: RingBufferBase
      Increment the start pointer by the given amount. Raises an invalid argument exception if the length is greater than RingBufferBase.available().
      Overrides:
      skip in class RingBufferBase<byte[]>
    • append

      public int append(int maxRemaining, ToIntFunction<ByteBuffer> callback)
      Provide a byte buffer view over the ring buffer to directly write bytes into a backing array of this buffer. The buffer provides place for at most capacity() bytes.
    • getArrayOps

      public ArrayOps<byte[]> getArrayOps()
      Append data from the byte buffer.
    • shallowClone

      public RingBufferForBytes shallowClone()
      Returns a new instance with the same data but a copy of the start and end pointers. The purpose is to support reading data from the buffer and eventually reset the state.
    • shallowClone

      public RingBufferForBytes shallowClone(int customStart, int length)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toString

      public String toString(Charset charset)