Class RandomAccessFileInputStream.Builder

    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • get

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

        You must set input that supports RandomAccessFile or File, otherwise, this method throws an exception. Only set one of RandomAccessFile or an origin that can be converted to a File.

        This builder use the following aspects:

        • RandomAccessFile
        • File
        • closeOnClose
        Returns:
        a new instance.
        Throws:
        java.lang.IllegalStateException - if the origin is null.
        java.lang.IllegalStateException - if both RandomAccessFile and origin are set.
        java.lang.UnsupportedOperationException - if the origin cannot be converted to 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