Module methanol

Interface Store.EntryReader

  • Enclosing interface:
    Store

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

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default int read​(java.nio.ByteBuffer dst)
      Synchronous variant of read(ByteBuffer, Executor).
      default java.util.concurrent.CompletableFuture<java.lang.Integer> read​(java.nio.ByteBuffer dst, java.util.concurrent.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.
      default long read​(java.util.List<java.nio.ByteBuffer> dsts)
      Synchronous variant of read(List, Executor).
      java.util.concurrent.CompletableFuture<java.lang.Long> read​(java.util.List<java.nio.ByteBuffer> dsts, java.util.concurrent.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.
    • Method Detail

      • read

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

        default java.util.concurrent.CompletableFuture<java.lang.Integer> read​(java.nio.ByteBuffer dst,
                                                                               java.util.concurrent.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:
        java.lang.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​(java.util.List<java.nio.ByteBuffer> dsts)
                   throws java.io.IOException
        Synchronous variant of read(List, Executor).
        Throws:
        java.lang.IllegalStateException - if the viewer is closed or if a read is currently in progress and the store doesn't allow concurrent reads
        java.io.IOException
      • read

        java.util.concurrent.CompletableFuture<java.lang.Long> read​(java.util.List<java.nio.ByteBuffer> dsts,
                                                                    java.util.concurrent.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:
        java.lang.IllegalStateException - if the viewer is closed or if a read is currently in progress and the store doesn't allow concurrent reads