public class BosonWriter extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_RECURSION_DEPTH
The maximum number of times methods can invoked themselves.
|
protected Set<ReadMutator> |
mutators |
protected AtomicInteger |
reference |
protected HashMap<Object,Integer> |
references |
static Charset |
utf8 |
| Constructor and Description |
|---|
BosonWriter() |
BosonWriter(Set<ReadMutator> mutators) |
| Modifier and Type | Method and Description |
|---|---|
io.netty.buffer.ByteBuf |
serialize(BosonMessage msg)
Serializes a
BosonMessage to the wire format specified by the protocol spec |
io.netty.buffer.ByteBuf |
serialize(Object msg)
Serialize any object to a series of bytes.
|
void |
serializeRequest(io.netty.buffer.ByteBuf buffer,
BosonMessage msg) |
void |
serializeResponse(io.netty.buffer.ByteBuf buffer,
BosonMessage msg) |
void |
validateAndWriteType(io.netty.buffer.ByteBuf buffer,
Object param) |
void |
writeArray(io.netty.buffer.ByteBuf buffer,
Object[] value)
Write an array of any supported boson type to the given buffer.
|
void |
writeBoolean(io.netty.buffer.ByteBuf buffer,
boolean b) |
void |
writeByte(io.netty.buffer.ByteBuf buffer,
byte b) |
void |
writeChar(io.netty.buffer.ByteBuf buffer,
char c) |
void |
writeDouble(io.netty.buffer.ByteBuf buffer,
double d) |
void |
writeEnum(io.netty.buffer.ByteBuf buf,
Enum param) |
void |
writeFloat(io.netty.buffer.ByteBuf buffer,
float f) |
void |
writeInt(io.netty.buffer.ByteBuf buffer,
int i) |
void |
writeList(io.netty.buffer.ByteBuf buffer,
List<Object> value) |
void |
writeLong(io.netty.buffer.ByteBuf buffer,
long l) |
void |
writeMap(io.netty.buffer.ByteBuf buffer,
Map<?,?> value) |
void |
writeNull(io.netty.buffer.ByteBuf buffer) |
void |
writePolo(io.netty.buffer.ByteBuf buffer,
Object obj,
int ref)
Serialize any* Java object.
|
void |
writeSet(io.netty.buffer.ByteBuf buffer,
Set<Object> value) |
void |
writeShort(io.netty.buffer.ByteBuf buffer,
short s) |
void |
writeString(io.netty.buffer.ByteBuf buffer,
String s) |
public static final int MAX_RECURSION_DEPTH
public static final Charset utf8
protected final AtomicInteger reference
protected final Set<ReadMutator> mutators
public BosonWriter()
public BosonWriter(Set<ReadMutator> mutators)
public io.netty.buffer.ByteBuf serialize(Object msg)
serialize(io.higgs.boson.BosonMessage) except it doesn't contain
any Boson headers required for network transportmsg - the message to serializepublic io.netty.buffer.ByteBuf serialize(BosonMessage msg)
BosonMessage to the wire format specified by the protocol specmsg - the message to serializepublic void serializeResponse(io.netty.buffer.ByteBuf buffer,
BosonMessage msg)
public void serializeRequest(io.netty.buffer.ByteBuf buffer,
BosonMessage msg)
public void writeByte(io.netty.buffer.ByteBuf buffer,
byte b)
public void writeNull(io.netty.buffer.ByteBuf buffer)
public void writeShort(io.netty.buffer.ByteBuf buffer,
short s)
public void writeInt(io.netty.buffer.ByteBuf buffer,
int i)
public void writeLong(io.netty.buffer.ByteBuf buffer,
long l)
public void writeFloat(io.netty.buffer.ByteBuf buffer,
float f)
public void writeDouble(io.netty.buffer.ByteBuf buffer,
double d)
public void writeBoolean(io.netty.buffer.ByteBuf buffer,
boolean b)
public void writeChar(io.netty.buffer.ByteBuf buffer,
char c)
public void writeString(io.netty.buffer.ByteBuf buffer,
String s)
public void writeEnum(io.netty.buffer.ByteBuf buf,
Enum param)
public void writeArray(io.netty.buffer.ByteBuf buffer,
Object[] value)
value - the value to writepublic void writeMap(io.netty.buffer.ByteBuf buffer,
Map<?,?> value)
public void writePolo(io.netty.buffer.ByteBuf buffer,
Object obj,
int ref)
obj - the object to writeref - public void validateAndWriteType(io.netty.buffer.ByteBuf buffer,
Object param)
buffer - the buffer to write toparam - the param to write to the bufferCopyright © 2012-2015. All Rights Reserved.