Class ReadableChannelWithLimit<A, X extends ReadableChannel<A>>
java.lang.Object
org.aksw.commons.io.input.ReadableChannelWithLimit<A,X>
- All Implemented Interfaces:
Closeable, AutoCloseable, Channel, HasArrayOps<A>, ReadableChannel<A>, ReadableSource<A>
public class ReadableChannelWithLimit<A, X extends ReadableChannel<A>>
extends Object
implements ReadableChannel<A>
-
Field Details
-
delegate
-
limit
protected long limit -
remaining
protected long remaining
-
-
Constructor Details
-
ReadableChannelWithLimit
-
-
Method Details
-
getDelegate
-
getArrayOps
- Specified by:
getArrayOpsin interfaceHasArrayOps<A>
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceChannel- Specified by:
closein interfaceCloseable- Throws:
IOException
-
isOpen
-
read
Description copied from interface:ReadableSourceRead method following the usual InputStream protocol.- Specified by:
readin interfaceReadableSource<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
-