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, readFully
read
public long getFileLength()
public DatanodeInfo getCurrentDatanode()
public Block getCurrentBlock()
public void close() throws IOException
close
在接口中 Closeable
close
在接口中 AutoCloseable
close
在类中 InputStream
IOException
public int read() throws IOException
read
在类中 InputStream
IOException
public int read(byte[] buf, int off, int len) throws IOException
read
在类中 InputStream
IOException
public int read(long position, byte[] buffer, int offset, int length) throws IOException
read
在接口中 PositionedReadable
read
在类中 FSInputStream
position
- start read from this positionbuffer
- read bufferoffset
- offset into bufferlength
- number of bytes to readIOException
public long skip(long n) throws IOException
skip
在类中 InputStream
IOException
public void seek(long targetPos) throws IOException
seek
在接口中 Seekable
seek
在类中 FSInputStream
IOException
public boolean seekToNewSource(long targetPos) throws IOException
seekToNewSource
在接口中 Seekable
seekToNewSource
在类中 FSInputStream
IOException
public long getPos() throws IOException
FSInputStream
getPos
在接口中 Seekable
getPos
在类中 FSInputStream
IOException
public int available() throws IOException
available
在类中 InputStream
IOException
public boolean markSupported()
markSupported
在类中 InputStream
public void mark(int readLimit)
mark
在类中 InputStream
public void reset() throws IOException
reset
在类中 InputStream
IOException
Copyright © 2009 The Apache Software Foundation