Package org.apache.commons.io.input
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 SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionget()Builds a newBufferedFileChannelInputStream.setFileChannel(FileChannel fileChannel) Sets the file channel.Methods inherited from class org.apache.commons.io.build.AbstractStreamBuildergetBufferSize, getBufferSizeDefault, getCharSequence, getCharset, getCharsetDefault, getFile, getInputStream, getOpenOptions, getOutputStream, getPath, getRandomAccessFile, getReader, getWriter, setBufferSize, setBufferSize, setBufferSizeChecker, setBufferSizeDefault, setBufferSizeMax, setCharset, setCharset, setCharsetDefault, setOpenOptionsMethods inherited from class org.apache.commons.io.build.AbstractOriginSuppliercheckOrigin, 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 org.apache.commons.io.build.AbstractSupplierasThisMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.commons.io.function.IOSupplierasSupplier, getUnchecked
- 
Constructor Details- 
Builderpublic Builder()Constructs a new builder ofBufferedFileChannelInputStream.
 
- 
- 
Method Details- 
getBuilds a newBufferedFileChannelInputStream.You must set an aspect that supports AbstractStreamBuilder.getInputStream(), otherwise, this method throws an exception.This builder uses the following aspects: - FileChanneltakes precedence is set.
- AbstractStreamBuilder.getPath()if the file channel is not set.
- AbstractStreamBuilder.getBufferSize()
 - Returns:
- a new instance.
- Throws:
- IllegalStateException- if the- originis- null.
- UnsupportedOperationException- if the origin cannot be converted to a- Path.
- IOException- if an I/O error occurs converting to an- Pathusing- AbstractStreamBuilder.getPath().
- See Also:
 
- 
setFileChannelSets the file channel.This setting takes precedence over all others. - Parameters:
- fileChannel- the file channel.
- Returns:
- this instance.
- Since:
- 2.18.0
 
 
-