Package org.apache.flink.core.fs.local
Class LocalDataInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.apache.flink.core.fs.FSDataInputStream
-
- org.apache.flink.core.fs.local.LocalDataInputStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable
@Internal public class LocalDataInputStream extends FSDataInputStream
TheLocalDataInputStreamclass is a wrapper class for a data input stream to the local file system.
-
-
Constructor Summary
Constructors Constructor Description LocalDataInputStream(File file)Constructs a newLocalDataInputStreamobject from a givenFileobject.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidclose()longgetPos()Gets the current position in the input stream.intread()intread(byte[] buffer, int offset, int length)voidseek(long desired)Seek to the given offset from the start of the file.longskip(long n)-
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, transferTo
-
-
-
-
Constructor Detail
-
LocalDataInputStream
public LocalDataInputStream(File file) throws IOException
Constructs a newLocalDataInputStreamobject from a givenFileobject.- Parameters:
file- The File the data stream is read from- Throws:
IOException- Thrown if the data input stream cannot be created.
-
-
Method Detail
-
seek
public void seek(long desired) throws IOExceptionDescription copied from class:FSDataInputStreamSeek to the given offset from the start of the file. The next read() will be from that location. Can't seek past the end of the stream.- Specified by:
seekin classFSDataInputStream- Parameters:
desired- the desired offset- Throws:
IOException- Thrown if an error occurred while seeking inside the input stream.
-
getPos
public long getPos() throws IOExceptionDescription copied from class:FSDataInputStreamGets the current position in the input stream.- Specified by:
getPosin classFSDataInputStream- Returns:
- current position in the input stream
- Throws:
IOException- Thrown if an I/O error occurred in the underlying stream implementation while accessing the stream's position.
-
read
public int read() throws IOException- Specified by:
readin classInputStream- Throws:
IOException
-
read
public int read(@Nonnull byte[] buffer, int offset, int length) throws IOException
- Overrides:
readin classInputStream- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
available
public int available() throws IOException- Overrides:
availablein classInputStream- Throws:
IOException
-
skip
public long skip(long n) throws IOException- Overrides:
skipin classInputStream- Throws:
IOException
-
-