public static class CachableBlockFile.BlockRead extends DataInputStream implements ABlockReader
in
Constructor and Description |
---|
BlockRead(InputStream in,
long size) |
Modifier and Type | Method and Description |
---|---|
byte[] |
getBuffer()
The byte array returned by this method is only for read optimizations, it should not be
modified.
|
<T> T |
getIndex(Class<T> clazz) |
int |
getPosition()
Get the file position.
|
DataInputStream |
getStream()
It is intended that the caller of this method will close the stream we also only intend that
this be called once per BlockRead.
|
boolean |
isIndexable()
An indexable block supports seeking, getting a position, and associating an arbitrary index
with the block
|
void |
seek(int position) |
read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, readUTF, skipBytes
available, close, mark, markSupported, read, reset, skip
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close
readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, skipBytes
public BlockRead(InputStream in, long size)
public DataInputStream getStream() throws IOException
getStream
in interface ABlockReader
IOException
public boolean isIndexable()
ABlockReader
isIndexable
in interface ABlockReader
public void seek(int position)
seek
in interface ABlockReader
public int getPosition()
ABlockReader
getPosition
in interface ABlockReader
public <T> T getIndex(Class<T> clazz)
getIndex
in interface ABlockReader
public byte[] getBuffer()
getBuffer
in interface ABlockReader
Copyright © 2011–2018 The Apache Software Foundation. All rights reserved.