Class FSDataInputStreamWrapper
- java.lang.Object
-
- org.apache.flink.formats.avro.utils.FSDataInputStreamWrapper
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.apache.avro.file.SeekableInput
public class FSDataInputStreamWrapper extends Object implements Closeable, org.apache.avro.file.SeekableInput
Code copy pasted from org.apache.avro.mapred.FSInput (which is Apache licensed as well).The wrapper keeps track of the position in the data stream.
-
-
Constructor Summary
Constructors Constructor Description FSDataInputStreamWrapper(FSDataInputStream stream, long len)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
long
length()
int
read(byte[] b, int off, int len)
void
seek(long p)
long
tell()
-
-
-
Constructor Detail
-
FSDataInputStreamWrapper
public FSDataInputStreamWrapper(FSDataInputStream stream, long len)
-
-
Method Detail
-
length
public long length() throws IOException
- Specified by:
length
in interfaceorg.apache.avro.file.SeekableInput
- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException
- Specified by:
read
in interfaceorg.apache.avro.file.SeekableInput
- Throws:
IOException
-
seek
public void seek(long p) throws IOException
- Specified by:
seek
in interfaceorg.apache.avro.file.SeekableInput
- Throws:
IOException
-
tell
public long tell() throws IOException
- Specified by:
tell
in interfaceorg.apache.avro.file.SeekableInput
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
-