Class ReadableChannelWithBlockAdvertisementBuffered

java.lang.Object
org.aksw.commons.util.closeable.AutoCloseableBase
org.aksw.commons.util.closeable.AutoCloseableWithLeakDetectionBase
org.aksw.commons.io.shared.ChannelBase
org.aksw.commons.io.input.ReadableChannelBase<byte[]>
org.aksw.commons.io.hadoop.ReadableChannelWithBlockAdvertisementBuffered
All Implemented Interfaces:
Closeable, AutoCloseable, Channel, HasArrayOps<byte[]>, ReadableChannel<byte[]>, ReadableSource<byte[]>

public class ReadableChannelWithBlockAdvertisementBuffered extends ReadableChannelBase<byte[]>
  • Field Details

    • decodedIn

      protected InputStream decodedIn
    • seekable

      protected org.apache.hadoop.fs.Seekable seekable
    • startPos

      protected long startPos
    • currentPos

      protected long currentPos
    • buffer

      protected byte[] buffer
    • pendingByte

      protected byte pendingByte
    • pendingByteState

      protected int pendingByteState
    • endOfBlockMarker

      protected int endOfBlockMarker
    • readCount

      protected long readCount
  • Constructor Details

    • ReadableChannelWithBlockAdvertisementBuffered

      public ReadableChannelWithBlockAdvertisementBuffered(InputStream decodedIn) throws IOException
      Throws:
      IOException
    • ReadableChannelWithBlockAdvertisementBuffered

      public ReadableChannelWithBlockAdvertisementBuffered(InputStream decodedIn, int endOfBlockMarker) throws IOException
      Throws:
      IOException
  • Method Details

    • position

      public long position() throws IOException
      Throws:
      IOException
    • getStartPos

      public long getStartPos()
    • getCurrentPos

      public long getCurrentPos()
    • read

      public int read(byte[] array, int position, int length) throws IOException
      Throws:
      IOException
    • onBlockEnd

      protected int onBlockEnd(ByteBuffer dst, long oldPos, long newPos)
    • getArrayOps

      public ArrayOps<byte[]> getArrayOps()
    • adjustToNextBlock

      public boolean adjustToNextBlock() throws IOException
      Discard bytes from this channel until a -2 read result is encountered.
      Throws:
      IOException