|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.InputStream org.apache.cassandra.io.util.MappedFileDataInput
public class MappedFileDataInput
Constructor Summary | |
---|---|
MappedFileDataInput(java.nio.MappedByteBuffer buffer,
java.lang.String filename,
long absoluteStartPosition)
|
|
MappedFileDataInput(java.nio.MappedByteBuffer buffer,
java.lang.String filename,
long absoluteStartPosition,
int position)
|
Method Summary | |
---|---|
int |
bytesPastMark()
|
long |
getAbsolutePosition()
|
java.lang.String |
getPath()
|
boolean |
isEOF()
|
void |
mark()
|
void |
mark(int ignored)
|
boolean |
markSupported()
|
int |
read()
|
boolean |
readBoolean()
Reads a boolean from the current position in this file. |
byte |
readByte()
Reads an 8-bit byte from the current position in this file. |
char |
readChar()
Reads a 16-bit character from the current position in this file. |
double |
readDouble()
Reads a 64-bit double from the current position in this file. |
float |
readFloat()
Reads a 32-bit float from the current position in this file. |
void |
readFully(byte[] buffer)
Reads bytes from this file into buffer . |
void |
readFully(byte[] buffer,
int offset,
int count)
Read bytes from this file into buffer starting at offset offset . |
int |
readInt()
Reads a 32-bit integer from the current position in this file. |
java.lang.String |
readLine()
Reads a line of text form the current position in this file. |
long |
readLong()
Reads a 64-bit long from the current position in this file. |
short |
readShort()
Reads a 16-bit short from the current position in this file. |
int |
readUnsignedByte()
Reads an unsigned 8-bit byte from the current position in this file and returns it as an integer. |
int |
readUnsignedShort()
Reads an unsigned 16-bit short from the current position in this file and returns it as an integer. |
java.lang.String |
readUTF()
Reads a string that is encoded in modified UTF-8 from
this file. |
void |
reset()
|
int |
skipBytes(int n)
|
Methods inherited from class java.io.InputStream |
---|
available, close, read, read, skip |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.io.Closeable |
---|
close |
Constructor Detail |
---|
public MappedFileDataInput(java.nio.MappedByteBuffer buffer, java.lang.String filename, long absoluteStartPosition)
public MappedFileDataInput(java.nio.MappedByteBuffer buffer, java.lang.String filename, long absoluteStartPosition, int position)
Method Detail |
---|
public long getAbsolutePosition()
getAbsolutePosition
in interface FileDataInput
public boolean markSupported()
markSupported
in class java.io.InputStream
public void mark(int ignored)
mark
in class java.io.InputStream
public void reset() throws java.io.IOException
reset
in interface FileDataInput
reset
in class java.io.InputStream
java.io.IOException
public void mark()
mark
in interface FileDataInput
public int bytesPastMark()
bytesPastMark
in interface FileDataInput
public boolean isEOF() throws java.io.IOException
isEOF
in interface FileDataInput
java.io.IOException
public java.lang.String getPath()
getPath
in interface FileDataInput
public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public int skipBytes(int n) throws java.io.IOException
skipBytes
in interface java.io.DataInput
java.io.IOException
public final boolean readBoolean() throws java.io.IOException
readBoolean
in interface java.io.DataInput
java.io.EOFException
- if the end of this file is detected.
java.io.IOException
- if this file is closed or another I/O error occurs.public final byte readByte() throws java.io.IOException
readByte
in interface java.io.DataInput
java.io.EOFException
- if the end of this file is detected.
java.io.IOException
- if this file is closed or another I/O error occurs.public final char readChar() throws java.io.IOException
readChar
in interface java.io.DataInput
java.io.EOFException
- if the end of this file is detected.
java.io.IOException
- if this file is closed or another I/O error occurs.public final double readDouble() throws java.io.IOException
readDouble
in interface java.io.DataInput
java.io.EOFException
- if the end of this file is detected.
java.io.IOException
- if this file is closed or another I/O error occurs.public final float readFloat() throws java.io.IOException
readFloat
in interface java.io.DataInput
java.io.EOFException
- if the end of this file is detected.
java.io.IOException
- if this file is closed or another I/O error occurs.public final void readFully(byte[] buffer) throws java.io.IOException
buffer
. Blocks until buffer.length
number of bytes have been read, the end of the file is
reached or an exception is thrown.
readFully
in interface java.io.DataInput
buffer
- the buffer to read bytes into.
java.io.EOFException
- if the end of this file is detected.
java.io.IOException
- if this file is closed or another I/O error occurs.
java.lang.NullPointerException
- if buffer
is null
.public final void readFully(byte[] buffer, int offset, int count) throws java.io.IOException
buffer
starting at offset offset
. This method blocks until count
number of bytes have been
read.
readFully
in interface java.io.DataInput
buffer
- the buffer to read bytes into.offset
- the initial position in buffer
to store the bytes read
from this file.count
- the maximum number of bytes to store in buffer
.
java.io.EOFException
- if the end of this file is detected.
java.lang.IndexOutOfBoundsException
- if offset < 0
or count < 0
, or if offset + count
is greater than the length of buffer
.
java.io.IOException
- if this file is closed or another I/O error occurs.
java.lang.NullPointerException
- if buffer
is null
.public final int readInt() throws java.io.IOException
readInt
in interface java.io.DataInput
java.io.EOFException
- if the end of this file is detected.
java.io.IOException
- if this file is closed or another I/O error occurs.public 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.DataInput
null
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 final long readLong() throws java.io.IOException
readLong
in interface java.io.DataInput
java.io.EOFException
- if the end of this file is detected.
java.io.IOException
- if this file is closed or another I/O error occurs.public final short readShort() throws java.io.IOException
readShort
in interface java.io.DataInput
java.io.EOFException
- if the end of this file is detected.
java.io.IOException
- if this file is closed or another I/O error occurs.public final int readUnsignedByte() throws java.io.IOException
readUnsignedByte
in interface java.io.DataInput
java.io.EOFException
- if the end of this file is detected.
java.io.IOException
- if this file is closed or another I/O error occurs.public final int readUnsignedShort() throws java.io.IOException
readUnsignedShort
in interface java.io.DataInput
java.io.EOFException
- if the end of this file is detected.
java.io.IOException
- if this file is closed or another I/O error occurs.public final java.lang.String readUTF() throws java.io.IOException
modified UTF-8
from
this file. The number of bytes that must be read for the complete string
is determined by the first two bytes read from the file. Blocks until all
required bytes have been read, the end of the file is reached or an
exception is thrown.
readUTF
in interface java.io.DataInput
modified UTF-8
from
this file.
java.io.EOFException
- if the end of this file is detected.
java.io.IOException
- if this file is closed or another I/O error occurs.
java.io.UTFDataFormatException
- if the bytes read cannot be decoded into a character string.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |