public final class ByteBuffersDataInput extends DataInput implements Accountable, RandomAccessInput
| Constructor and Description |
|---|
ByteBuffersDataInput(List<ByteBuffer> buffers)
Read data from a set of contiguous buffers.
|
| Modifier and Type | Method and Description |
|---|---|
long |
position() |
long |
ramBytesUsed()
Return the memory usage of this object in bytes.
|
byte |
readByte()
Reads and returns a single byte.
|
byte |
readByte(long pos)
Reads a byte at the given position in the file
|
void |
readBytes(byte[] arr,
int off,
int len)
Reads a specified number of bytes into an array at the specified offset.
|
void |
readBytes(ByteBuffer buffer,
int len)
Reads exactly
len bytes into the given buffer. |
int |
readInt(long pos)
Reads an integer at the given position in the file
|
long |
readLong(long pos)
Reads a long at the given position in the file
|
short |
readShort(long pos)
Reads a short at the given position in the file
|
void |
seek(long position) |
long |
size() |
ByteBuffersDataInput |
slice(long offset,
long length) |
String |
toString() |
clone, readBytes, readInt, readLELongs, readLong, readMapOfStrings, readSetOfStrings, readShort, readString, readVInt, readVLong, readZInt, readZLong, skipBytesequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetChildResourcespublic ByteBuffersDataInput(List<ByteBuffer> buffers)
public long size()
public long ramBytesUsed()
AccountableramBytesUsed in interface Accountablepublic byte readByte()
throws EOFException
DataInputreadByte in class DataInputEOFExceptionDataOutput.writeByte(byte)public void readBytes(ByteBuffer buffer, int len) throws EOFException
len bytes into the given buffer. The buffer must have
enough remaining limit.
If there are fewer than len bytes in the input, EOFException
is thrown.EOFExceptionpublic void readBytes(byte[] arr,
int off,
int len)
throws EOFException
DataInputreadBytes in class DataInputarr - the array to read bytes intooff - the offset in the array to start storing byteslen - the number of bytes to readEOFExceptionDataOutput.writeBytes(byte[],int)public byte readByte(long pos)
RandomAccessInputreadByte in interface RandomAccessInputDataInput.readByte()public short readShort(long pos)
RandomAccessInputreadShort in interface RandomAccessInputDataInput.readShort()public int readInt(long pos)
RandomAccessInputreadInt in interface RandomAccessInputDataInput.readInt()public long readLong(long pos)
RandomAccessInputreadLong in interface RandomAccessInputDataInput.readLong()public long position()
public void seek(long position)
throws EOFException
EOFExceptionpublic ByteBuffersDataInput slice(long offset, long length)
Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.