public class JSONByteIOFramer extends Object implements ByteIOFramer
Constructor and Description |
---|
JSONByteIOFramer(Trace msgTrace,
MessageReceiver receiver,
String label)
Constructor.
|
JSONByteIOFramer(Trace msgTrace,
MessageReceiver receiver,
String label,
ChunkyByteArrayInputStream in)
Constructor with explicit input.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
produceBytes(Object message)
Generate the bytes for writing a message to a connection.
|
void |
receiveBytes(byte[] data,
int length)
Process bytes of data received.
|
public JSONByteIOFramer(Trace msgTrace, MessageReceiver receiver, String label)
public JSONByteIOFramer(Trace msgTrace, MessageReceiver receiver, String label, ChunkyByteArrayInputStream in)
public void receiveBytes(byte[] data, int length) throws IOException
receiveBytes
in interface ByteIOFramer
data
- The bytes received.length
- Number of usable bytes in 'data'. End of input is
indicated by passing a 'length' value of 0.IOException
public byte[] produceBytes(Object message) throws IOException
produceBytes
in interface ByteIOFramer
message
- The message to be written. In this implementation,
the message must be a string.IOException
Copyright © 2017. All rights reserved.