public class TypedBytesInput extends Object
Constructor and Description |
---|
TypedBytesInput(DataInput in)
Creates a new instance of TypedBytesInput.
|
Modifier and Type | Method and Description |
---|---|
static TypedBytesInput |
get(DataInput in)
Get a thread-local typed bytes input for the supplied
DataInput . |
Object |
read()
Reads a typed bytes sequence and converts it to a Java object.
|
boolean |
readBool()
Reads the boolean following a
Type.BOOL code. |
byte |
readByte()
Reads the byte following a
Type.BYTE code. |
byte[] |
readBytes()
Reads the bytes following a
Type.BYTES code. |
double |
readDouble()
Reads the double following a
Type.DOUBLE code. |
float |
readFloat()
Reads the float following a
Type.FLOAT code. |
int |
readInt()
Reads the integer following a
Type.INT code. |
List |
readList()
Reads the list following a
Type.LIST code. |
long |
readLong()
Reads the long following a
Type.LONG code. |
TreeMap |
readMap()
Reads the map following a
Type.MAP code. |
int |
readMapHeader()
Reads the header following a
Type.MAP code. |
byte[] |
readRaw()
Reads a typed bytes sequence.
|
byte[] |
readRawBool()
Reads the raw bytes following a
Type.BOOL code. |
byte[] |
readRawByte()
Reads the raw byte following a
Type.BYTE code. |
byte[] |
readRawBytes()
Reads the raw bytes following a
Type.BYTES code. |
byte[] |
readRawDouble()
Reads the raw bytes following a
Type.DOUBLE code. |
byte[] |
readRawFloat()
Reads the raw bytes following a
Type.FLOAT code. |
byte[] |
readRawInt()
Reads the raw bytes following a
Type.INT code. |
byte[] |
readRawLong()
Reads the raw bytes following a
Type.LONG code. |
byte[] |
readRawString()
Reads the raw bytes following a
Type.STRING code. |
short |
readShort()
Reads the short following a
Type.SHORT code. |
String |
readString()
Reads the string following a
Type.STRING code. |
Type |
readType()
Reads a type byte and returns the corresponding
Type . |
ArrayList |
readVector()
Reads the vector following a
Type.VECTOR code. |
int |
readVectorHeader()
Reads the header following a
Type.VECTOR code. |
boolean |
skipType()
Skips a type byte.
|
public TypedBytesInput(DataInput in)
public static TypedBytesInput get(DataInput in)
DataInput
.in
- data input objectDataInput
.public Object read() throws IOException
IOException
public byte[] readRaw() throws IOException
IOException
public Type readType() throws IOException
Type
.IOException
public boolean skipType() throws IOException
IOException
public byte[] readBytes() throws IOException
Type.BYTES
code.IOException
public byte[] readRawBytes() throws IOException
Type.BYTES
code.IOException
public byte readByte() throws IOException
Type.BYTE
code.IOException
public byte[] readRawByte() throws IOException
Type.BYTE
code.IOException
public boolean readBool() throws IOException
Type.BOOL
code.IOException
public byte[] readRawBool() throws IOException
Type.BOOL
code.IOException
public int readInt() throws IOException
Type.INT
code.IOException
public short readShort() throws IOException
Type.SHORT
code.IOException
public byte[] readRawInt() throws IOException
Type.INT
code.IOException
public long readLong() throws IOException
Type.LONG
code.IOException
public byte[] readRawLong() throws IOException
Type.LONG
code.IOException
public float readFloat() throws IOException
Type.FLOAT
code.IOException
public byte[] readRawFloat() throws IOException
Type.FLOAT
code.IOException
public double readDouble() throws IOException
Type.DOUBLE
code.IOException
public byte[] readRawDouble() throws IOException
Type.DOUBLE
code.IOException
public String readString() throws IOException
Type.STRING
code.IOException
public byte[] readRawString() throws IOException
Type.STRING
code.IOException
public ArrayList readVector() throws IOException
Type.VECTOR
code.IOException
public int readVectorHeader() throws IOException
Type.VECTOR
code.IOException
public List readList() throws IOException
Type.LIST
code.IOException
public TreeMap readMap() throws IOException
Type.MAP
code.IOException
public int readMapHeader() throws IOException
Type.MAP
code.IOException
Copyright © 2021 The Apache Software Foundation. All rights reserved.