? BufferedFileChannelInputStream
java.lang.Object
java.io.InputStream
org.apache.commons.io.input.BufferedFileChannelInputStream
- ????????:
Closeable
,AutoCloseable
InputStream
implementation which uses direct buffer to read a file to avoid extra copy of data between Java
and native memory which happens when using BufferedInputStream
. Unfortunately, this is not something
already available in JDK, sun.nio.ch.ChannelInputStream
supports reading a file using NIO, but does not
support buffering.
This class was ported and adapted from Apache Spark commit 933dc6cb7b3de1d8ccaf73d124d6eb95b947ed19 where it was
called NioBufferedFileInputStream
.
- ???????:
- 2.9.0
-
?????
????????Constructs a new instance for the given File.BufferedFileChannelInputStream
(File file, int bufferSizeInBytes) Constructs a new instance for the given File and buffer size.Constructs a new instance for the given Path.BufferedFileChannelInputStream
(Path path, int bufferSizeInBytes) Constructs a new instance for the given Path and buffer size. -
????
??????? java.io.InputStream
mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skipNBytes, transferTo
-
???????
-
BufferedFileChannelInputStream
Constructs a new instance for the given File.- ??:
file
- The file to stream.- ??:
IOException
- If an I/O error occurs
-
BufferedFileChannelInputStream
Constructs a new instance for the given File and buffer size.- ??:
file
- The file to stream.bufferSizeInBytes
- buffer size.- ??:
IOException
- If an I/O error occurs
-
BufferedFileChannelInputStream
Constructs a new instance for the given Path.- ??:
path
- The path to stream.- ??:
IOException
- If an I/O error occurs
-
BufferedFileChannelInputStream
Constructs a new instance for the given Path and buffer size.- ??:
path
- The path to stream.bufferSizeInBytes
- buffer size.- ??:
IOException
- If an I/O error occurs
-
-
??????
-
available
- ??:
available
???InputStream
- ??:
IOException
-
close
- ???:
close
????AutoCloseable
- ???:
close
????Closeable
- ??:
close
???InputStream
- ??:
IOException
-
read
- ???:
read
???InputStream
- ??:
IOException
-
read
- ??:
read
???InputStream
- ??:
IOException
-
skip
- ??:
skip
???InputStream
- ??:
IOException
-