Interface ReadableChannel<A>
- Type Parameters:
A
- The array type for transferring data in blocks
- All Superinterfaces:
AutoCloseable
,Channel
,Closeable
,HasArrayOps<A>
- All Known Implementing Classes:
ReadableChannelBase
,ReadableChannelOverSliceAccessor
,ReadableChannelWithLimit
A data stream allows for repeated retrieval of arrays of consecutive items.
Data streams can be seen as a low level generalizaton / unification of Iterators and InputStreams.
Akin to an InputStream, the
ReadableChannel
interface does not provide a seek() method.
Usually there should be another factory that creates data streams
for given offsets. The reason is, that a sequential reader is typically backed by a stream of items
(such as a http response, or a sql/sparql result set) and that stream needs to be re-created when
jumping to arbitrary offsets.-
Method Summary
Methods inherited from interface org.apache.jena.sparql.service.enhancer.slice.api.HasArrayOps
getArrayOps
-
Method Details
-
read
Read method following the usual InputStream protocol.- 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
-
readRaw
- Throws:
IOException
-