public static class RandomAccessFileInputStream.Builder extends AbstractStreamBuilder<RandomAccessFileInputStream,RandomAccessFileInputStream.Builder>
RandomAccessFileInputStream.
For example:
RandomAccessFileInputStream s = RandomAccessFileInputStream.builder()
.setPath(path)
.setCloseOnClose(true)
.get();
get()| Modifier and Type | Field and Description |
|---|---|
private boolean |
closeOnClose |
private java.io.RandomAccessFile |
randomAccessFile |
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
RandomAccessFileInputStream |
get()
Builds a new
RandomAccessFileInputStream. |
RandomAccessFileInputStream.Builder |
setCloseOnClose(boolean closeOnClose)
Sets whether to close the underlying file when this stream is closed.
|
RandomAccessFileInputStream.Builder |
setRandomAccessFile(java.io.RandomAccessFile randomAccessFile)
Sets the RandomAccessFile to stream.
|
getBufferSize, getBufferSizeDefault, getCharSequence, getCharset, getCharsetDefault, getInputStream, getOpenOptions, getOutputStream, getPath, getReader, getWriter, setBufferSize, setBufferSize, setBufferSizeChecker, setBufferSizeDefault, setBufferSizeMax, setCharset, setCharset, setCharsetDefault, setOpenOptionscheckOrigin, getOrigin, hasOrigin, newByteArrayOrigin, newCharSequenceOrigin, newFileOrigin, newFileOrigin, newInputStreamOrigin, newOutputStreamOrigin, newPathOrigin, newPathOrigin, newReaderOrigin, newURIOrigin, newWriterOrigin, setByteArray, setCharSequence, setFile, setFile, setInputStream, setOrigin, setOutputStream, setPath, setPath, setReader, setURI, setWriterasThisclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitasSupplierprivate java.io.RandomAccessFile randomAccessFile
private boolean closeOnClose
public RandomAccessFileInputStream get() throws java.io.IOException
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:
RandomAccessFileFilejava.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.AbstractOrigin.getFile()public RandomAccessFileInputStream.Builder setCloseOnClose(boolean closeOnClose)
closeOnClose - Whether to close the underlying file when this stream is closed.public RandomAccessFileInputStream.Builder setRandomAccessFile(java.io.RandomAccessFile randomAccessFile)
randomAccessFile - the RandomAccessFile to stream.