Package org.apache.flink.core.fs
Class FSDataInputStreamWrapper
- java.lang.Object
-
- java.io.InputStream
-
- org.apache.flink.core.fs.FSDataInputStream
-
- org.apache.flink.core.fs.FSDataInputStreamWrapper
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,WrappingProxy<FSDataInputStream>
- Direct Known Subclasses:
ClosingFSDataInputStream
,FsSegmentDataInputStream
@Internal public class FSDataInputStreamWrapper extends FSDataInputStream implements WrappingProxy<FSDataInputStream>
Simple forwarding wrapper aroundFSDataInputStream
.
-
-
Field Summary
Fields Modifier and Type Field Description protected FSDataInputStream
inputStream
-
Constructor Summary
Constructors Constructor Description FSDataInputStreamWrapper(FSDataInputStream inputStream)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
available()
void
close()
long
getPos()
Gets the current position in the input stream.FSDataInputStream
getWrappedDelegate()
void
mark(int readlimit)
boolean
markSupported()
int
read()
int
read(byte[] b)
int
read(byte[] b, int off, int len)
void
reset()
void
seek(long desired)
Seek to the given offset from the start of the file.long
skip(long n)
-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Field Detail
-
inputStream
protected final FSDataInputStream inputStream
-
-
Constructor Detail
-
FSDataInputStreamWrapper
public FSDataInputStreamWrapper(FSDataInputStream inputStream)
-
-
Method Detail
-
seek
public void seek(long desired) throws IOException
Description copied from class:FSDataInputStream
Seek 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:
seek
in classFSDataInputStream
- Parameters:
desired
- the desired offset- Throws:
IOException
- Thrown if an error occurred while seeking inside the input stream.
-
getPos
public long getPos() throws IOException
Description copied from class:FSDataInputStream
Gets the current position in the input stream.- Specified by:
getPos
in 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:
read
in classInputStream
- Throws:
IOException
-
read
public int read(byte[] b) throws IOException
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException
- Overrides:
read
in classInputStream
- Throws:
IOException
-
skip
public long skip(long n) throws IOException
- Overrides:
skip
in classInputStream
- Throws:
IOException
-
available
public int available() throws IOException
- Overrides:
available
in classInputStream
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
mark
public void mark(int readlimit)
- Overrides:
mark
in classInputStream
-
reset
public void reset() throws IOException
- Overrides:
reset
in classInputStream
- Throws:
IOException
-
markSupported
public boolean markSupported()
- Overrides:
markSupported
in classInputStream
-
getWrappedDelegate
public FSDataInputStream getWrappedDelegate()
- Specified by:
getWrappedDelegate
in interfaceWrappingProxy<FSDataInputStream>
-
-