Interface Store.EntryReader

Enclosing interface:
Store

public static interface Store.EntryReader
A reader for an entry's data stream.
  • Method Details

    • read

      default int read(ByteBuffer dst) throws IOException
      Synchronous variant of read(ByteBuffer, Executor).
      Throws:
      IllegalStateException - if the viewer is closed or if a read is currently in progress and the store doesn't allow concurrent reads
      IOException
    • read

      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 -1 if 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

      default long read(List<ByteBuffer> dsts) throws IOException
      Synchronous variant of read(List, Executor).
      Throws:
      IllegalStateException - if the viewer is closed or if a read is currently in progress and the store doesn't allow concurrent reads
      IOException
    • read

      CompletableFuture<Long> 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 -1 if 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