Class NioBufferedFileInputStream

Object
java.io.InputStream
org.apache.spark.io.NioBufferedFileInputStream
All Implemented Interfaces:
Closeable, AutoCloseable

public final class NioBufferedFileInputStream extends InputStream
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.