public class DFSClient.DFSInputStream extends FSInputStream
| 限定符和类型 | 方法和说明 |
|---|---|
int |
available() |
void |
close()
Close it down!
|
Block |
getCurrentBlock()
Returns the block containing the target position.
|
DatanodeInfo |
getCurrentDatanode()
Returns the datanode from which the stream is currently reading.
|
long |
getFileLength() |
long |
getPos()
Return the current offset from the start of the file
|
void |
mark(int readLimit) |
boolean |
markSupported()
We definitely don't support marks
|
int |
read() |
int |
read(byte[] buf,
int off,
int len)
Read the entire buffer.
|
int |
read(long position,
byte[] buffer,
int offset,
int length)
Read bytes starting from the specified position.
|
void |
reset() |
void |
seek(long targetPos)
Seek to a new arbitrary location
|
boolean |
seekToNewSource(long targetPos)
Seek to given position on a node other than the current node.
|
long |
skip(long n) |
readFully, readFullyreadpublic long getFileLength()
public DatanodeInfo getCurrentDatanode()
public Block getCurrentBlock()
public void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableclose 在类中 InputStreamIOExceptionpublic int read()
throws IOException
read 在类中 InputStreamIOExceptionpublic int read(byte[] buf,
int off,
int len)
throws IOException
read 在类中 InputStreamIOExceptionpublic int read(long position,
byte[] buffer,
int offset,
int length)
throws IOException
read 在接口中 PositionedReadableread 在类中 FSInputStreamposition - start read from this positionbuffer - read bufferoffset - offset into bufferlength - number of bytes to readIOExceptionpublic long skip(long n)
throws IOException
skip 在类中 InputStreamIOExceptionpublic void seek(long targetPos)
throws IOException
seek 在接口中 Seekableseek 在类中 FSInputStreamIOExceptionpublic boolean seekToNewSource(long targetPos)
throws IOException
seekToNewSource 在接口中 SeekableseekToNewSource 在类中 FSInputStreamIOExceptionpublic long getPos()
throws IOException
FSInputStreamgetPos 在接口中 SeekablegetPos 在类中 FSInputStreamIOExceptionpublic int available()
throws IOException
available 在类中 InputStreamIOExceptionpublic boolean markSupported()
markSupported 在类中 InputStreampublic void mark(int readLimit)
mark 在类中 InputStreampublic void reset()
throws IOException
reset 在类中 InputStreamIOExceptionCopyright © 2009 The Apache Software Foundation