public class TypedBytesInput extends Object
| 构造器和说明 |
|---|
TypedBytesInput(DataInput in)
Creates a new instance of TypedBytesInput.
|
| 限定符和类型 | 方法和说明 |
|---|---|
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[] |
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. |
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
IOExceptionpublic byte[] readRaw()
throws IOException
IOExceptionpublic Type readType() throws IOException
Type.IOExceptionpublic boolean skipType()
throws IOException
IOExceptionpublic byte[] readBytes()
throws IOException
Type.BYTES code.IOExceptionpublic byte[] readRawBytes(int code)
throws IOException
code - the custom type codeIOExceptionpublic byte[] readRawBytes()
throws IOException
Type.BYTES code.IOExceptionpublic byte readByte()
throws IOException
Type.BYTE code.IOExceptionpublic byte[] readRawByte()
throws IOException
Type.BYTE code.IOExceptionpublic boolean readBool()
throws IOException
Type.BOOL code.IOExceptionpublic byte[] readRawBool()
throws IOException
Type.BOOL code.IOExceptionpublic int readInt()
throws IOException
Type.INT code.IOExceptionpublic byte[] readRawInt()
throws IOException
Type.INT code.IOExceptionpublic long readLong()
throws IOException
Type.LONG code.IOExceptionpublic byte[] readRawLong()
throws IOException
Type.LONG code.IOExceptionpublic float readFloat()
throws IOException
Type.FLOAT code.IOExceptionpublic byte[] readRawFloat()
throws IOException
Type.FLOAT code.IOExceptionpublic double readDouble()
throws IOException
Type.DOUBLE code.IOExceptionpublic byte[] readRawDouble()
throws IOException
Type.DOUBLE code.IOExceptionpublic String readString() throws IOException
Type.STRING code.IOExceptionpublic byte[] readRawString()
throws IOException
Type.STRING code.IOExceptionpublic ArrayList readVector() throws IOException
Type.VECTOR code.IOExceptionpublic byte[] readRawVector()
throws IOException
Type.VECTOR code.IOExceptionpublic int readVectorHeader()
throws IOException
Type.VECTOR code.IOExceptionpublic List readList() throws IOException
Type.LIST code.IOExceptionpublic byte[] readRawList()
throws IOException
Type.LIST code.IOExceptionpublic TreeMap readMap() throws IOException
Type.MAP code.IOExceptionpublic byte[] readRawMap()
throws IOException
Type.MAP code.IOExceptionpublic int readMapHeader()
throws IOException
Type.MAP code.IOExceptionCopyright © 2009 The Apache Software Foundation