public class BosonReader extends Object
| Modifier and Type | Field and Description |
|---|---|
protected ClassLoader |
loader |
protected org.slf4j.Logger |
log |
protected Set<WriteMutator> |
mutators |
protected IdentityHashMap<Integer,Object> |
references |
| Constructor and Description |
|---|
BosonReader() |
BosonReader(Set<WriteMutator> mutators) |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
deSerialize(io.netty.buffer.ByteBuf buf) |
void |
deSerialize(io.netty.buffer.ByteBuf data,
BosonMessage msg) |
Object[] |
readArray(io.netty.buffer.ByteBuf data,
boolean verified,
int verifiedType)
Read an array from the buffer
|
boolean |
readBoolean(io.netty.buffer.ByteBuf data,
boolean verified,
int verifiedType)
Read a a single byte from the buffer if the byte is 1 then returns true, otherwise false
|
byte |
readByte(io.netty.buffer.ByteBuf data,
boolean verified,
int verifiedType)
Read a single byte from the buffer
|
char |
readChar(io.netty.buffer.ByteBuf data,
boolean verified,
int verifiedType)
Read a char (16 bits) from the buffer
|
double |
readDouble(io.netty.buffer.ByteBuf data,
boolean verified,
int verifiedType)
Read a double (64 bit floating point) from the buffer
|
Enum |
readEnum(io.netty.buffer.ByteBuf data,
boolean verified,
int verifiedType) |
float |
readFloat(io.netty.buffer.ByteBuf data,
boolean verified,
int verifiedType)
Read a float (32 bit floating point) from the buffer
|
int |
readInt(io.netty.buffer.ByteBuf data,
boolean verified,
int verifiedType)
Read an int (4 bytes) from the buffer
|
List<Object> |
readList(io.netty.buffer.ByteBuf data,
boolean verified,
int verifiedType)
Read a List from the buffer
|
long |
readLong(io.netty.buffer.ByteBuf data,
boolean verified,
int verifiedType)
Read a long (8 bytes) from the buffer
|
Map<Object,Object> |
readMap(io.netty.buffer.ByteBuf data,
boolean verified,
int verifiedType)
Read a map (list of key -> value pairs) from the buffer
|
Object |
readPolo(io.netty.buffer.ByteBuf data,
boolean verified,
int verifiedType) |
Object |
readReference(io.netty.buffer.ByteBuf data,
boolean verified,
int verifiedType) |
Set<Object> |
readSet(io.netty.buffer.ByteBuf data,
boolean verified,
int verifiedType) |
short |
readShort(io.netty.buffer.ByteBuf data,
boolean verified,
int verifiedType)
Read a short (16 bits) from the buffer
|
String |
readString(io.netty.buffer.ByteBuf data,
boolean verified,
int verifiedType)
Read a UTF-8 string from the buffer
|
Object |
readType(io.netty.buffer.ByteBuf buffer) |
Object |
readType(io.netty.buffer.ByteBuf data,
int type)
Read the next type from the buffer.
|
void |
verifyReadable(io.netty.buffer.ByteBuf data)
Check that the backing buffer is readable.
|
protected final Set<WriteMutator> mutators
protected org.slf4j.Logger log
protected ClassLoader loader
protected IdentityHashMap<Integer,Object> references
public BosonReader()
public BosonReader(Set<WriteMutator> mutators)
public <T> T deSerialize(io.netty.buffer.ByteBuf buf)
public void deSerialize(io.netty.buffer.ByteBuf data,
BosonMessage msg)
public void verifyReadable(io.netty.buffer.ByteBuf data)
InvalidDataException - if buffer is not readablepublic String readString(io.netty.buffer.ByteBuf data, boolean verified, int verifiedType)
data - verified - if true then the verifiedType param is used to match the type, if false then
a single byte is read from the buffer to determine the typeverifiedType - the data type to be de-serializedpublic Enum readEnum(io.netty.buffer.ByteBuf data, boolean verified, int verifiedType)
public byte readByte(io.netty.buffer.ByteBuf data,
boolean verified,
int verifiedType)
verified - if true then the verifiedType param is used to match the type, if false then
a single byte is read from the buffer to determine the typeverifiedType - the data type to be de-serializedpublic short readShort(io.netty.buffer.ByteBuf data,
boolean verified,
int verifiedType)
verified - if true then the verifiedType param is used to match the type, if false then
a single byte is read from the buffer to determine the typeverifiedType - the data type to be de-serializedpublic int readInt(io.netty.buffer.ByteBuf data,
boolean verified,
int verifiedType)
verified - if true then the verifiedType param is used to match the type, if false then
a single byte is read from the buffer to determine the typeverifiedType - the data type to be de-serializedpublic long readLong(io.netty.buffer.ByteBuf data,
boolean verified,
int verifiedType)
verified - if true then the verifiedType param is used to match the type, if false then
a single byte is read from the buffer to determine the typeverifiedType - the data type to be de-serializedpublic float readFloat(io.netty.buffer.ByteBuf data,
boolean verified,
int verifiedType)
verified - if true then the verifiedType param is used to match the type, if false then
a single byte is read from the buffer to determine the typeverifiedType - the data type to be de-serializedpublic double readDouble(io.netty.buffer.ByteBuf data,
boolean verified,
int verifiedType)
verified - if true then the verifiedType param is used to match the type, if false then
a single byte is read from the buffer to determine the typeverifiedType - the data type to be de-serializedpublic boolean readBoolean(io.netty.buffer.ByteBuf data,
boolean verified,
int verifiedType)
verified - if true then the verifiedType param is used to match the type, if false then
a single byte is read from the buffer to determine the typeverifiedType - the data type to be de-serializedpublic char readChar(io.netty.buffer.ByteBuf data,
boolean verified,
int verifiedType)
verified - if true then the verifiedType param is used to match the type, if false then
a single byte is read from the buffer to determine the typeverifiedType - the data type to be de-serializedpublic Object[] readArray(io.netty.buffer.ByteBuf data, boolean verified, int verifiedType)
data - verified - if true then the verifiedType param is used to match the type, if false then
a single byte is read from the buffer to determine the typeverifiedType - the data type to be de-serializedpublic List<Object> readList(io.netty.buffer.ByteBuf data, boolean verified, int verifiedType)
verified - if true then the verifiedType param is used to match the type, if false then
a single byte is read from the buffer to determine the typeverifiedType - the data type to be de-serializedpublic Set<Object> readSet(io.netty.buffer.ByteBuf data, boolean verified, int verifiedType)
public Map<Object,Object> readMap(io.netty.buffer.ByteBuf data, boolean verified, int verifiedType)
verified - if true then the verifiedType param is used to match the type, if false then
a single byte is read from the buffer to determine the typeverifiedType - the data type to be de-serializedpublic Object readPolo(io.netty.buffer.ByteBuf data, boolean verified, int verifiedType)
public Object readReference(io.netty.buffer.ByteBuf data, boolean verified, int verifiedType)
public Object readType(io.netty.buffer.ByteBuf data, int type)
type - the 1 byte integer representing a Boson typepublic Object readType(io.netty.buffer.ByteBuf buffer)
Copyright © 2012-2015. All Rights Reserved.