Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
0.8.0
-
None
-
None
Description
Currently, if a ByteBuffer is passed into Message(), it treats the buffer as the message's buffer (including magic byte, meta data, etc) rather than the payload. If you wish to construct a Message and provide just the payload, you have to use a byte array, which results in an extra copy if your payload data is already in a byte buffer.
For optimization, it would be nice to also provide a constructor like:
this(payload: ByteBuffer, isPayload: Boolean)
The existing this(buffer: ByteBuffer) constructor could then just be changed to this(buffer, false).