private class Protocol.Writer
extends java.lang.Object
implements java.lang.Runnable
| Modifier and Type | Field and Description |
|---|---|
private Protocol.ByteArrayOutputStream2 |
baos
Pre-allocated helper buffers for object flattening
|
private static int |
BUFFER_SIZE
Default size of buffer for object flattening
|
private byte[] |
data
Holder for data to be written out
|
private java.io.ByteArrayOutputStream |
res |
| Modifier | Constructor and Description |
|---|---|
private |
Writer() |
| Modifier and Type | Method and Description |
|---|---|
private byte[] |
objToByteArray(Message obj)
Serialize the given object into an in-memory array of bytes.
|
void |
run()
This method obtains messages from the Outbound Queue and writes them
into output stream.
|
private void |
setData(byte[] data)
Set new value of the
data field (by be used in lambdas) |
private static final int BUFFER_SIZE
private Protocol.ByteArrayOutputStream2 baos
private java.io.ByteArrayOutputStream res
private byte[] data
private void setData(byte[] data)
data field (by be used in lambdas)data - new value of the fieldpublic void run()
run in interface java.lang.Runnableprivate byte[] objToByteArray(Message obj) throws java.io.IOException
obj - The graph of objects to be converted.java.io.IOException - on error