Interface Store.EntryReader
- Enclosing interface:
Store
public static interface Store.EntryReader
A reader for an entry's data stream.
-
Method Summary
Modifier and TypeMethodDescriptiondefault intread(ByteBuffer dst) Synchronous variant ofread(ByteBuffer, Executor).default CompletableFuture<Integer> read(ByteBuffer dst, Executor executor) Reads as many bytes as possible from the data stream into the given buffer, and returns the number of read bytes, or-1if reached EOF.default longread(List<ByteBuffer> dsts) Synchronous variant ofread(List, Executor).read(List<ByteBuffer> dsts, Executor executor) Reads as many bytes as possible from the data stream into the given buffers, in sequential order, and returns the number of read bytes, or-1if reached EOF.
-
Method Details
-
read
Synchronous variant ofread(ByteBuffer, Executor).- Throws:
IllegalStateException- if the viewer is closed or if a read is currently in progress and the store doesn't allow concurrent readsIOException
-
read
Reads as many bytes as possible from the data stream into the given buffer, and returns the number of read bytes, or-1if reached EOF. The number returned is the maximum of the number of bytes remaining in the buffer or the stream.- Throws:
IllegalStateException- if the viewer is closed or if a read is currently in progress and the store doesn't allow concurrent reads
-
read
Synchronous variant ofread(List, Executor).- Throws:
IllegalStateException- if the viewer is closed or if a read is currently in progress and the store doesn't allow concurrent readsIOException
-
read
Reads as many bytes as possible from the data stream into the given buffers, in sequential order, and returns the number of read bytes, or-1if reached EOF. The number returned is the maximum of the number of bytes remaining in the buffer or the stream.- Throws:
IllegalStateException- if the viewer is closed or if a read is currently in progress and the store doesn't allow concurrent reads
-