public class HdfsFileInputStream extends InputStream implements org.apache.hadoop.fs.Seekable, org.apache.hadoop.fs.PositionedReadable
| Constructor and Description |
|---|
HdfsFileInputStream(TachyonFS tfs,
int fileId,
org.apache.hadoop.fs.Path hdfsPath,
org.apache.hadoop.conf.Configuration conf,
int bufferSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
long |
getPos()
Return the current offset from the start of the file
|
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
int |
read(long position,
byte[] buffer,
int offset,
int length)
Read upto the specified number of bytes, from a given position within a
file, and return the number of bytes read.
|
void |
readFully(long position,
byte[] buffer)
Read number of bytes equalt to the length of the buffer, from a given
position within a file.
|
void |
readFully(long position,
byte[] buffer,
int offset,
int length)
Read the specified number of bytes, from a given position within a file.
|
void |
seek(long pos)
Seek to the given offset from the start of the file.
|
boolean |
seekToNewSource(long targetPos)
Seeks a different copy of the data.
|
available, mark, markSupported, reset, skippublic HdfsFileInputStream(TachyonFS tfs, int fileId, org.apache.hadoop.fs.Path hdfsPath, org.apache.hadoop.conf.Configuration conf, int bufferSize) throws IOException
IOExceptionpublic 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[] b)
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] b,
int off,
int len)
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
seekToNewSource in interface org.apache.hadoop.fs.SeekableIOExceptionCopyright © 2014. All rights reserved.