private class Protocol.Writer
extends java.lang.Object
implements java.lang.Runnable
Modifier and Type | Field and Description |
---|---|
private Protocol.ByteArrayOutputStream2 |
baos |
private byte[] |
data |
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 final Protocol.ByteArrayOutputStream2 baos
private final 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.Runnable
private byte[] objToByteArray(Message obj) throws java.io.IOException
obj
- The graph of objects to be converted.java.io.IOException
- on error