Constructor and Description |
---|
ByteArrayDataInput() |
ByteArrayDataInput(byte[] bytes) |
ByteArrayDataInput(byte[] bytes,
int offset,
int len) |
Modifier and Type | Method and Description |
---|---|
boolean |
eof() |
int |
getPosition() |
int |
length() |
byte |
readByte()
Reads and returns a single byte.
|
void |
readBytes(byte[] b,
int offset,
int len)
Reads a specified number of bytes into an array at the specified offset.
|
int |
readInt()
Reads four bytes and returns an int.
|
long |
readLong()
Reads eight bytes and returns a long.
|
short |
readShort()
Reads two bytes and returns a short.
|
int |
readVInt()
Reads an int stored in variable-length format.
|
long |
readVLong()
Reads a long stored in variable-length format.
|
void |
reset(byte[] bytes) |
void |
reset(byte[] bytes,
int offset,
int len) |
void |
rewind() |
void |
setPosition(int pos) |
void |
skipBytes(long count)
Skip over
numBytes bytes. |
clone, readBytes, readLELongs, readMapOfStrings, readSetOfStrings, readString, readZInt, readZLong
public ByteArrayDataInput(byte[] bytes)
public ByteArrayDataInput(byte[] bytes, int offset, int len)
public ByteArrayDataInput()
public void reset(byte[] bytes)
public void rewind()
public int getPosition()
public void setPosition(int pos)
public void reset(byte[] bytes, int offset, int len)
public int length()
public boolean eof()
public void skipBytes(long count)
DataInput
numBytes
bytes. The contract on this method is that it
should have the same behavior as reading the same number of bytes into a
buffer and discarding its content. Negative values of numBytes
are not supported.public short readShort()
DataInput
readShort
in class DataInput
DataOutput.writeByte(byte)
public int readInt()
DataInput
readInt
in class DataInput
DataOutput.writeInt(int)
public long readLong()
DataInput
readLong
in class DataInput
DataOutput.writeLong(long)
public int readVInt()
DataInput
The format is described further in DataOutput.writeVInt(int)
.
readVInt
in class DataInput
DataOutput.writeVInt(int)
public long readVLong()
DataInput
The format is described further in DataOutput.writeVInt(int)
.
readVLong
in class DataInput
DataOutput.writeVLong(long)
public byte readByte()
DataInput
readByte
in class DataInput
DataOutput.writeByte(byte)
public void readBytes(byte[] b, int offset, int len)
DataInput
readBytes
in class DataInput
b
- the array to read bytes intooffset
- the offset in the array to start storing byteslen
- the number of bytes to readDataOutput.writeBytes(byte[],int)
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.