Class ReadableChannelOverSliceAccessor<A>

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<A>
org.aksw.commons.io.slice.ReadableChannelOverSliceAccessor<A>
All Implemented Interfaces:
Closeable, AutoCloseable, Channel, HasArrayOps<A>, ReadableChannel<A>, ReadableSource<A>

public class ReadableChannelOverSliceAccessor<A> extends ReadableChannelBase<A>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected SliceAccessor<A>
     
    protected long
     

    Fields inherited from class org.aksw.commons.util.closeable.AutoCloseableWithLeakDetectionBase

    instantiationStackTrace

    Fields inherited from class org.aksw.commons.util.closeable.AutoCloseableBase

    closeStackTrace, enableCloseStackTrace, isClosed
  • Constructor Summary

    Constructors
    Constructor
    Description
    ReadableChannelOverSliceAccessor(SliceAccessor<A> accessor, long posInSlice)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
     
    int
    read(A array, int position, int length)
    Read method following the usual InputStream protocol.

    Methods inherited from class org.aksw.commons.io.shared.ChannelBase

    isOpen

    Methods inherited from class org.aksw.commons.util.closeable.AutoCloseableWithLeakDetectionBase

    finalize, getInstantiationStackTrace

    Methods inherited from class org.aksw.commons.util.closeable.AutoCloseableBase

    close, ensureOpen, throwClosedException

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.nio.channels.Channel

    close, isOpen

    Methods inherited from interface org.aksw.commons.io.input.ReadableSource

    readRaw
  • Field Details

    • accessor

      protected SliceAccessor<A> accessor
    • posInSlice

      protected long posInSlice
  • Constructor Details

    • ReadableChannelOverSliceAccessor

      public ReadableChannelOverSliceAccessor(SliceAccessor<A> accessor, long posInSlice)
  • Method Details

    • getArrayOps

      public ArrayOps<A> getArrayOps()
    • closeActual

      public void closeActual() throws IOException
      Overrides:
      closeActual in class org.aksw.commons.util.closeable.AutoCloseableBase
      Throws:
      IOException
    • read

      public int read(A array, int position, int length) throws IOException
      Description copied from interface: ReadableSource
      Read method following the usual InputStream protocol.
      Parameters:
      array - The array into which to put the read data
      position - Offset into array where to start writing
      length - Maximum number of items to read.
      Returns:
      The number of items read. Return -1 if end of data was reached, and 0 iff length was 0.
      Throws:
      IOException