@NotThreadSafe public class HdfsFileInputStream extends InputStream implements org.apache.hadoop.fs.Seekable, org.apache.hadoop.fs.PositionedReadable
FileInStream with additional statistics gathering in a FileSystem.Statistics object.| Constructor and Description |
|---|
HdfsFileInputStream(FileSystem fs,
alluxio.AlluxioURI uri,
org.apache.hadoop.fs.FileSystem.Statistics stats)
Constructs a new stream for reading a file from HDFS.
|
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
close() |
long |
getPos() |
int |
read() |
int |
read(byte[] buffer) |
int |
read(byte[] buffer,
int offset,
int length) |
int |
read(long position,
byte[] buffer,
int offset,
int length) |
void |
readFully(long position,
byte[] buffer) |
void |
readFully(long position,
byte[] buffer,
int offset,
int length) |
void |
seek(long pos) |
boolean |
seekToNewSource(long targetPos)
This method is not supported in
HdfsFileInputStream. |
long |
skip(long n) |
mark, markSupported, resetpublic HdfsFileInputStream(FileSystem fs, alluxio.AlluxioURI uri, org.apache.hadoop.fs.FileSystem.Statistics stats) throws IOException
fs - the file systemuri - the Alluxio file URIstats - filesystem statisticsIOExceptionpublic int available()
throws IOException
available in class InputStreamIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class InputStreamIOExceptionpublic long getPos()
throws IOException
getPos in interface org.apache.hadoop.fs.SeekableIOExceptionpublic int read()
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] buffer)
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] buffer,
int offset,
int length)
throws IOException
read in class InputStreamIOExceptionpublic int read(long position,
byte[] buffer,
int offset,
int length)
throws IOException
read in interface org.apache.hadoop.fs.PositionedReadableIOExceptionpublic void readFully(long position,
byte[] buffer)
throws IOException
readFully in interface org.apache.hadoop.fs.PositionedReadableIOExceptionpublic void readFully(long position,
byte[] buffer,
int offset,
int length)
throws IOException
readFully in interface org.apache.hadoop.fs.PositionedReadableIOExceptionpublic void seek(long pos)
throws IOException
seek in interface org.apache.hadoop.fs.SeekableIOExceptionpublic boolean seekToNewSource(long targetPos)
throws IOException
HdfsFileInputStream.seekToNewSource in interface org.apache.hadoop.fs.SeekabletargetPos - N/AIOException - alwayspublic long skip(long n)
throws IOException
skip in class InputStreamIOExceptionCopyright © 2024. All Rights Reserved.