Class BufferedFileChannelInputStream.Builder
java.lang.Object
org.apache.commons.io.build.AbstractSupplier<BufferedFileChannelInputStream, BufferedFileChannelInputStream.Builder>
org.apache.commons.io.build.AbstractOriginSupplier<BufferedFileChannelInputStream, BufferedFileChannelInputStream.Builder>
org.apache.commons.io.build.AbstractStreamBuilder<BufferedFileChannelInputStream, BufferedFileChannelInputStream.Builder>
org.apache.commons.io.input.BufferedFileChannelInputStream.Builder
- All Implemented Interfaces:
IOSupplier<BufferedFileChannelInputStream>
- Enclosing class:
BufferedFileChannelInputStream
public static class BufferedFileChannelInputStream.Builder
extends AbstractStreamBuilder<BufferedFileChannelInputStream, BufferedFileChannelInputStream.Builder>
Builds a new
BufferedFileChannelInputStream.
Using File IO:
BufferedFileChannelInputStream s = BufferedFileChannelInputStream.builder()
.setFile(file)
.setBufferSize(4096)
.get();
Using NIO Path:
BufferedFileChannelInputStream s = BufferedFileChannelInputStream.builder()
.setPath(path)
.setBufferSize(4096)
.get();
- Since:
- 2.12.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget()Builds a newBufferedFileChannelInputStream.setFileChannel(FileChannel fileChannel) Sets the file channel.Methods inherited from class AbstractStreamBuilder
getBufferSize, getBufferSizeDefault, getCharSequence, getCharset, getCharsetDefault, getFile, getInputStream, getOpenOptions, getOutputStream, getPath, getRandomAccessFile, getReader, getWriter, setBufferSize, setBufferSize, setBufferSizeChecker, setBufferSizeDefault, setBufferSizeMax, setCharset, setCharset, setCharsetDefault, setOpenOptionsMethods inherited from class AbstractOriginSupplier
checkOrigin, getOrigin, hasOrigin, newByteArrayOrigin, newCharSequenceOrigin, newFileOrigin, newFileOrigin, newInputStreamOrigin, newOutputStreamOrigin, newPathOrigin, newPathOrigin, newRandomAccessFileOrigin, newRandomAccessFileOrigin, newReaderOrigin, newURIOrigin, newWriterOrigin, setByteArray, setCharSequence, setFile, setFile, setInputStream, setOrigin, setOutputStream, setPath, setPath, setRandomAccessFile, setRandomAccessFile, setReader, setURI, setWriterMethods inherited from class AbstractSupplier
asThisMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IOSupplier
asSupplier, getUnchecked
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
get
Builds a newBufferedFileChannelInputStream.You must set input that supports
AbstractStreamBuilder.getInputStream(), otherwise, this method throws an exception.This builder use the following aspects:
- Returns:
- a new instance.
- Throws:
IllegalStateException- if theoriginisnull.UnsupportedOperationException- if the origin cannot be converted to aPath.IOException- If an I/O error occurs- See Also:
-
setFileChannel
Sets the file channel.This setting takes precedence over all others.
- Parameters:
fileChannel- the file channel.- Returns:
- this instance.
- Since:
- 2.18.0
-