Class ReadRange
- java.lang.Object
-
- org.trellisldp.ext.cassandra.query.CassandraQuery
-
- org.trellisldp.ext.cassandra.query.binary.BinaryQuery
-
- org.trellisldp.ext.cassandra.query.binary.BinaryReadQuery
-
- org.trellisldp.ext.cassandra.query.binary.ReadRange
-
@ApplicationScoped public class ReadRange extends BinaryReadQuery
Reads a range of bytes from a binary to anInputStream.
-
-
Field Summary
-
Fields inherited from class org.trellisldp.ext.cassandra.query.CassandraQuery
consistency, preparedStmtAsync, queryString, readBinaryWorkers, session, writeWorkers
-
-
Constructor Summary
Constructors Constructor Description ReadRange()For use with RESTeasy and CDI proxies.ReadRange(CqlSession session, ConsistencyLevel consistency)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompletionStage<InputStream>execute(IRI id, int first, int last)-
Methods inherited from class org.trellisldp.ext.cassandra.query.binary.BinaryReadQuery
retrieve
-
Methods inherited from class org.trellisldp.ext.cassandra.query.CassandraQuery
executeSyncRead, preparedStatementAsync
-
-
-
-
Constructor Detail
-
ReadRange
public ReadRange()
For use with RESTeasy and CDI proxies.- API Note:
- This construtor is used by CDI runtimes that require a public, no-argument constructor. It should not be invoked directly in user code.
-
ReadRange
@Inject public ReadRange(CqlSession session, @BinaryReadConsistency ConsistencyLevel consistency)
- Parameters:
session- the cassandra sessionconsistency- the consistency level
-
-
Method Detail
-
execute
public CompletionStage<InputStream> execute(IRI id, int first, int last)
- Parameters:
id- theIRIof a binary to readfirst- which byte to begin reading onlast- which byte to end reading on- Returns:
- An
InputStreamof bytes as requested. Theskipmethod of thisInputStreamis guaranteed to skip as many bytes as asked. - See Also:
BinaryReadQuery.retrieve(IRI, BoundStatement)
-
-