Class ReadAheadInputStream.Builder

    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • get

        public ReadAheadInputStream get()
                                 throws java.io.IOException
        Constructs a new instance.

        This builder use the aspects InputStream, OpenOption[], buffer size, ExecutorService.

        You must provide an origin that can be converted to an InputStream by this builder, otherwise, this call will throw an UnsupportedOperationException.

        Returns:
        a new instance.
        Throws:
        java.lang.UnsupportedOperationException - if the origin cannot provide an InputStream.
        java.io.IOException - if an I/O error occurs.
        See Also:
        AbstractStreamBuilder.getInputStream()
      • setExecutorService

        public ReadAheadInputStream.Builder setExecutorService​(java.util.concurrent.ExecutorService executorService)
        Sets the executor service for the read-ahead thread.
        Parameters:
        executorService - the executor service for the read-ahead thread.
        Returns:
        this