Class SeekableReadableChannelWithMonitor<A, X extends SeekableReadableChannel<A>>
java.lang.Object
org.aksw.commons.util.closeable.AutoCloseableWrapperBase<X>
org.aksw.commons.io.shared.ChannelDecoratorBase<X>
org.aksw.commons.io.input.ReadableChannelDecoratorBase<A,X>
org.aksw.commons.io.input.SeekableReadableChannelDecoratorBase<A,X>
org.aksw.commons.io.input.SeekableReadableChannelWithMonitor<A,X>
- All Implemented Interfaces:
Closeable, AutoCloseable, Cloneable, Channel, HasArrayOps<A>, HasPosition, ReadableChannel<A>, ReadableSource<A>, SeekableReadableChannel<A>
public class SeekableReadableChannelWithMonitor<A, X extends SeekableReadableChannel<A>>
extends SeekableReadableChannelDecoratorBase<A,X>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected longprotected ChannelMonitor2protected longprotected longprotected longFields inherited from class AutoCloseableWrapperBase
delegate -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class SeekableReadableChannelDecoratorBase
cloneObject, getArrayOps, positionMethods inherited from class ChannelDecoratorBase
close, isOpenMethods inherited from class AutoCloseableWrapperBase
close, getDelegateMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ReadableSource
readRaw
-
Field Details
-
monitor
-
cachedPos
protected long cachedPos -
relativeStart
protected long relativeStart -
readLength
protected long readLength -
readCounter
protected volatile long readCounter
-
-
Constructor Details
-
SeekableReadableChannelWithMonitor
-
-
Method Details
-
read
Description copied from interface:ReadableSourceRead method following the usual InputStream protocol.- Specified by:
readin interfaceReadableSource<A>- Overrides:
readin classSeekableReadableChannelDecoratorBase<A, X extends SeekableReadableChannel<A>>- Parameters:
array- The array into which to put the read dataposition- Offset into array where to start writinglength- 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
-
position
- Specified by:
positionin interfaceHasPosition- Overrides:
positionin classSeekableReadableChannelDecoratorBase<A, X extends SeekableReadableChannel<A>>- Throws:
IOException
-