public interface BlockReader extends ByteBufferReadable
| Modifier and Type | Method and Description |
|---|---|
int |
available()
Returns an estimate of the number of bytes that can be read
(or skipped over) from this input stream without performing
network I/O.
|
void |
close()
Close the block reader.
|
org.apache.hadoop.hdfs.shortcircuit.ClientMmap |
getClientMmap(EnumSet<ReadOption> opts)
Get a ClientMmap object for this BlockReader.
|
boolean |
isLocal() |
boolean |
isShortCircuit() |
int |
read(byte[] buf,
int off,
int len) |
int |
readAll(byte[] buf,
int offset,
int len)
Similar to
readFully(byte[], int, int) except that it will
not throw an exception on EOF. |
void |
readFully(byte[] buf,
int readOffset,
int amtToRead)
Read exactly the given amount of data, throwing an exception
if EOF is reached before that amount
|
long |
skip(long n)
Skip the given number of bytes
|
readint read(byte[] buf, int off, int len) throws IOException
IOExceptionlong skip(long n) throws IOException
IOExceptionint available() throws IOException
IOExceptionvoid close() throws IOException
IOExceptionvoid readFully(byte[] buf, int readOffset, int amtToRead) throws IOException
IOExceptionint readAll(byte[] buf, int offset, int len) throws IOException
readFully(byte[], int, int) except that it will
not throw an exception on EOF. However, it differs from the simple
read(byte[], int, int) call in that it is guaranteed to
read the data if it is available. In other words, if this call
does not throw an exception, then either the buffer has been
filled or the next call will return EOF.IOExceptionboolean isLocal()
boolean isShortCircuit()
org.apache.hadoop.hdfs.shortcircuit.ClientMmap getClientMmap(EnumSet<ReadOption> opts)
opts - The read options to use.Copyright © 2018 CERN. All Rights Reserved.