public final class HadoopDataInputStream extends FSDataInputStream
Modifier and Type | Field and Description |
---|---|
static int |
MIN_SKIP_BYTES |
Constructor and Description |
---|
HadoopDataInputStream(org.apache.hadoop.fs.FSDataInputStream dataInputStream) |
Modifier and Type | Method and Description |
---|---|
int |
available() |
void |
close() |
void |
forceSeek(long seekPos) |
org.apache.hadoop.fs.FSDataInputStream |
getHadoopInputStream() |
long |
getPos()
Gets the current position in the input stream.
|
java.io.Reader |
getReader() |
int |
read() |
int |
read(byte[] buffer,
int offset,
int length) |
void |
seek(long seekPosition)
Seek to the given offset from the start of the file.
|
long |
skip(long n) |
void |
skipFully(long bytes) |
public static final int MIN_SKIP_BYTES
public HadoopDataInputStream(org.apache.hadoop.fs.FSDataInputStream dataInputStream)
public void seek(long seekPosition) throws java.io.IOException
FSDataInputStream
seek
in class FSDataInputStream
seekPosition
- the desired offsetjava.io.IOException
- Thrown if an error occurred while seeking inside the input stream.public long getPos() throws java.io.IOException
FSDataInputStream
getPos
in class FSDataInputStream
java.io.IOException
- Thrown if an I/O error occurred in the underlying stream
implementation while accessing the stream's position.public java.io.Reader getReader()
getReader
in class FSDataInputStream
public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.InputStream
java.io.IOException
public int read(byte[] buffer, int offset, int length) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public int available() throws java.io.IOException
available
in class java.io.InputStream
java.io.IOException
public long skip(long n) throws java.io.IOException
skip
in class java.io.InputStream
java.io.IOException
public org.apache.hadoop.fs.FSDataInputStream getHadoopInputStream()
public void forceSeek(long seekPos) throws java.io.IOException
java.io.IOException
public void skipFully(long bytes) throws java.io.IOException
java.io.IOException