public class MappedFileDataInput extends AbstractDataInput implements FileDataInput
| Constructor and Description |
|---|
MappedFileDataInput(java.io.FileInputStream stream,
java.lang.String filename,
long segmentOffset,
int position) |
MappedFileDataInput(java.nio.MappedByteBuffer buffer,
java.lang.String filename,
long segmentOffset,
int position) |
| Modifier and Type | Method and Description |
|---|---|
long |
bytesPastMark(FileMark mark) |
long |
bytesRemaining() |
long |
getFilePointer() |
java.lang.String |
getPath() |
protected int |
getPosition() |
boolean |
isEOF() |
FileMark |
mark() |
boolean |
markSupported() |
int |
read() |
java.nio.ByteBuffer |
readBytes(int length)
Does the same thing as
readFully do but without copying data (thread safe) |
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. |
void |
reset(FileMark mark) |
void |
seek(long pos) |
protected void |
seekInternal(int pos) |
int |
skipBytes(int n) |
java.lang.String |
toString() |
readBoolean, readByte, readChar, readDouble, readFloat, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTFclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic MappedFileDataInput(java.io.FileInputStream stream,
java.lang.String filename,
long segmentOffset,
int position)
throws java.io.IOException
java.io.IOExceptionpublic MappedFileDataInput(java.nio.MappedByteBuffer buffer,
java.lang.String filename,
long segmentOffset,
int position)
protected void seekInternal(int pos)
seekInternal in class AbstractDataInputpublic void seek(long pos)
throws java.io.IOException
seek in interface FileDataInputjava.io.IOExceptionpublic long getFilePointer()
getFilePointer in interface FileDataInputprotected int getPosition()
getPosition in class AbstractDataInputpublic boolean markSupported()
markSupported in class java.io.InputStreampublic void reset(FileMark mark) throws java.io.IOException
reset in interface FileDataInputjava.io.IOExceptionpublic FileMark mark()
mark in interface FileDataInputpublic long bytesPastMark(FileMark mark)
bytesPastMark in interface FileDataInputpublic boolean isEOF()
throws java.io.IOException
isEOF in interface FileDataInputjava.io.IOExceptionpublic long bytesRemaining()
throws java.io.IOException
bytesRemaining in interface FileDataInputjava.io.IOExceptionpublic java.lang.String getPath()
getPath in interface FileDataInputpublic int read()
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic java.nio.ByteBuffer readBytes(int length)
throws java.io.IOException
readFully do but without copying data (thread safe)readBytes in interface FileDataInputlength - length of the bytes to readjava.io.IOException - on any fail of I/O operationpublic final void readFully(byte[] buffer)
throws java.io.IOException
AbstractDataInputbuffer. 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.DataInputreadFully in class AbstractDataInputbuffer - 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.public final void readFully(byte[] buffer,
int offset,
int count)
throws java.io.IOException
AbstractDataInputbuffer starting at offset offset. This method blocks until count number of bytes have been
read.readFully in interface java.io.DataInputreadFully in class AbstractDataInputbuffer - 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.io.IOException - if this file is closed or another I/O error occurs.public int skipBytes(int n)
throws java.io.IOException
skipBytes in interface java.io.DataInputjava.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2015 The Apache Software Foundation