Class RandomAccessFileInputStream.Builder

    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • get

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

        This builder use the aspects RandomAccessFile or File, and closeOnClose. Only set one of RandomAccessFile or an origin that can be converted to a File.

        If RandomAccessFile is not set, then you must provide an origin that can be converted to a File by this builder, otherwise, this call will throw an UnsupportedOperationException.

        Returns:
        a new instance.
        Throws:
        java.lang.IllegalStateException - if both RandomAccessFile and origin are set.
        java.lang.UnsupportedOperationException - if the origin cannot provide a File.
        java.io.IOException - if an I/O error occurs.
        See Also:
        AbstractOrigin.getFile()
      • setCloseOnClose

        public RandomAccessFileInputStream.Builder setCloseOnClose​(boolean closeOnClose)
        Sets whether to close the underlying file when this stream is closed.
        Parameters:
        closeOnClose - Whether to close the underlying file when this stream is closed.
        Returns:
        this
      • setRandomAccessFile

        public RandomAccessFileInputStream.Builder setRandomAccessFile​(java.io.RandomAccessFile randomAccessFile)
        Sets the RandomAccessFile to stream.
        Parameters:
        randomAccessFile - the RandomAccessFile to stream.
        Returns:
        this