public class RandomAccessReader extends RebufferingInputStream implements FileDataInput
DataInputPlus.DataInputStreamPlus| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_BUFFER_SIZE |
buffer| Modifier and Type | Method and Description |
|---|---|
int |
available() |
long |
bytesPastMark() |
long |
bytesPastMark(DataPosition mark) |
long |
bytesRemaining() |
void |
close() |
protected long |
current() |
ChannelProxy |
getChannel() |
double |
getCrcCheckChance() |
long |
getFilePointer() |
java.lang.String |
getPath() |
long |
getPosition() |
boolean |
isEOF() |
long |
length() |
DataPosition |
mark() |
boolean |
markSupported() |
static RandomAccessReader |
open(java.io.File file)
Open a RandomAccessReader (not compressed, not mmapped, no read throttling) that will own its channel.
|
java.lang.String |
readLine()
Reads a line of text form the current position in this file.
|
void |
reBuffer()
Read data from file starting from current currentOffset to populate buffer.
|
void |
reset() |
void |
reset(DataPosition mark) |
void |
seek(long newPosition) |
java.lang.String |
toString() |
read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLong, readPrimitiveSlowly, readShort, readUnsignedByte, readUnsignedShort, readUnsignedVInt, readUTF, readVInt, skipBytesclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitreadUnsignedVInt, readVInt, skipBytes, skipBytesFullypublic static final int DEFAULT_BUFFER_SIZE
public void reBuffer()
reBuffer in class RebufferingInputStreampublic long getFilePointer()
getFilePointer in interface FileDataInputprotected long current()
public java.lang.String getPath()
getPath in interface FileDataInputpublic ChannelProxy getChannel()
public void reset()
throws java.io.IOException
reset in class java.io.InputStreamjava.io.IOExceptionpublic boolean markSupported()
markSupported in class java.io.InputStreampublic long bytesPastMark()
public DataPosition mark()
mark in interface RewindableDataInputpublic void reset(DataPosition mark)
reset in interface RewindableDataInputpublic long bytesPastMark(DataPosition mark)
bytesPastMark in interface RewindableDataInputpublic boolean isEOF()
isEOF in interface FileDataInputpublic long bytesRemaining()
bytesRemaining in interface FileDataInputpublic int available()
throws java.io.IOException
available in class java.io.InputStreamjava.io.IOExceptionpublic void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.InputStreampublic java.lang.String toString()
toString in class java.lang.Objectpublic void seek(long newPosition)
seek in interface FileDataInputpublic final java.lang.String readLine()
throws java.io.IOException
'\n', '\r', "\r\n" or the end of file marker. The string does not
include the line terminating sequence.
Blocks until a line terminating sequence has been read, the end of the file is reached or an exception is thrown.
readLine in interface java.io.DataInputreadLine in class RebufferingInputStreamnull if no characters have
been read before the end of the file has been reached.java.io.IOException - if this file is closed or another I/O error occurs.public long length()
public long getPosition()
public double getCrcCheckChance()
public static RandomAccessReader open(java.io.File file)
file - File to open for readingCopyright © 2018 The Apache Software Foundation