Package org.apache.flink.api.common.io
Class InputStreamFSInputWrapper
- java.lang.Object
-
- java.io.InputStream
-
- org.apache.flink.core.fs.FSDataInputStream
-
- org.apache.flink.api.common.io.InputStreamFSInputWrapper
-
- All Implemented Interfaces:
Closeable,AutoCloseable
@Public public class InputStreamFSInputWrapper extends FSDataInputStream
This class wraps anInputStreamand exposes it asFSDataInputStream.
NB:seek(long)andgetPos()are currently not supported.
-
-
Constructor Summary
Constructors Constructor Description InputStreamFSInputWrapper(InputStream inStream)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()longgetPos()Gets the current position in the input stream.intread()intread(byte[] b)intread(byte[] b, int off, int len)voidseek(long desired)Seek to the given offset from the start of the file.-
Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
-
-
-
-
Constructor Detail
-
InputStreamFSInputWrapper
public InputStreamFSInputWrapper(InputStream inStream)
-
-
Method Detail
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
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(byte[] b, int off, int len) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
read
public int read(byte[] b) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
-