public class ByteBufferDataInput extends AbstractDataInput implements FileDataInput, java.io.DataInput
DataInputPlus.DataInputStreamPlus| Constructor and Description |
|---|
ByteBufferDataInput(java.nio.ByteBuffer 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() |
long |
getPosition() |
long |
getPositionLimit() |
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[] bytes)
Reads bytes from this file into
buffer. |
void |
readFully(byte[] bytes,
int offset,
int count)
Read bytes from this file into
buffer starting at offset offset. |
void |
reset(FileMark mark) |
void |
seek(long pos) |
java.lang.String |
toString() |
readBoolean, readByte, readChar, readDouble, readFloat, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, skipBytesclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitreadUnsignedVInt, readVIntpublic ByteBufferDataInput(java.nio.ByteBuffer buffer,
java.lang.String filename,
long segmentOffset,
int position)
public void seek(long pos)
throws java.io.IOException
seek in interface FileDataInputseek in class AbstractDataInputjava.io.IOExceptionpublic long getFilePointer()
getFilePointer in interface FileDataInputpublic long getPosition()
getPosition in class AbstractDataInputpublic long getPositionLimit()
getPositionLimit 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[] bytes)
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 AbstractDataInputbytes - 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[] bytes,
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 AbstractDataInputbytes - 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 java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2015 The Apache Software Foundation