public class TypedBytesInput
extends java.lang.Object
Constructor and Description |
---|
TypedBytesInput(java.io.DataInput in)
Creates a new instance of TypedBytesInput.
|
Modifier and Type | Method and Description |
---|---|
static TypedBytesInput |
get(java.io.DataInput in)
Get a thread-local typed bytes input for the supplied
DataInput . |
java.lang.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. |
java.util.List |
readList()
Reads the list following a
Type.LIST code. |
long |
readLong()
Reads the long following a
Type.LONG code. |
java.util.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[] |
readRawBytes(int code)
Reads the raw bytes following a custom 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[] |
readRawList()
Reads the raw bytes following a
Type.LIST code. |
byte[] |
readRawLong()
Reads the raw bytes following a
Type.LONG code. |
byte[] |
readRawMap()
Reads the raw bytes following a
Type.MAP code. |
byte[] |
readRawString()
Reads the raw bytes following a
Type.STRING code. |
byte[] |
readRawVector()
Reads the raw bytes following a
Type.VECTOR code. |
java.lang.String |
readString()
Reads the string following a
Type.STRING code. |
Type |
readType()
Reads a type byte and returns the corresponding
Type . |
java.util.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(java.io.DataInput in)
public static TypedBytesInput get(java.io.DataInput in)
DataInput
.in
- data input objectDataInput
.public java.lang.Object read() throws java.io.IOException
java.io.IOException
public byte[] readRaw() throws java.io.IOException
java.io.IOException
public Type readType() throws java.io.IOException
Type
.java.io.IOException
public boolean skipType() throws java.io.IOException
java.io.IOException
public byte[] readBytes() throws java.io.IOException
Type.BYTES
code.java.io.IOException
public byte[] readRawBytes(int code) throws java.io.IOException
code
- the custom type codejava.io.IOException
public byte[] readRawBytes() throws java.io.IOException
Type.BYTES
code.java.io.IOException
public byte readByte() throws java.io.IOException
Type.BYTE
code.java.io.IOException
public byte[] readRawByte() throws java.io.IOException
Type.BYTE
code.java.io.IOException
public boolean readBool() throws java.io.IOException
Type.BOOL
code.java.io.IOException
public byte[] readRawBool() throws java.io.IOException
Type.BOOL
code.java.io.IOException
public int readInt() throws java.io.IOException
Type.INT
code.java.io.IOException
public byte[] readRawInt() throws java.io.IOException
Type.INT
code.java.io.IOException
public long readLong() throws java.io.IOException
Type.LONG
code.java.io.IOException
public byte[] readRawLong() throws java.io.IOException
Type.LONG
code.java.io.IOException
public float readFloat() throws java.io.IOException
Type.FLOAT
code.java.io.IOException
public byte[] readRawFloat() throws java.io.IOException
Type.FLOAT
code.java.io.IOException
public double readDouble() throws java.io.IOException
Type.DOUBLE
code.java.io.IOException
public byte[] readRawDouble() throws java.io.IOException
Type.DOUBLE
code.java.io.IOException
public java.lang.String readString() throws java.io.IOException
Type.STRING
code.java.io.IOException
public byte[] readRawString() throws java.io.IOException
Type.STRING
code.java.io.IOException
public java.util.ArrayList readVector() throws java.io.IOException
Type.VECTOR
code.java.io.IOException
public byte[] readRawVector() throws java.io.IOException
Type.VECTOR
code.java.io.IOException
public int readVectorHeader() throws java.io.IOException
Type.VECTOR
code.java.io.IOException
public java.util.List readList() throws java.io.IOException
Type.LIST
code.java.io.IOException
public byte[] readRawList() throws java.io.IOException
Type.LIST
code.java.io.IOException
public java.util.TreeMap readMap() throws java.io.IOException
Type.MAP
code.java.io.IOException
public byte[] readRawMap() throws java.io.IOException
Type.MAP
code.java.io.IOException
public int readMapHeader() throws java.io.IOException
Type.MAP
code.java.io.IOException
Copyright © 2009 The Apache Software Foundation