Class IpcMessageBuilder
java.lang.Object
com._1c.g5.v8.dt.internal.pm.connection.mmf.IpcMessageBuilder
Builds
IpcMessage
from data from buffer.
Reads length of message in bytes from the first 4 bytes of the first append(ByteBuffer)
, then all remaining
bytes from buffer at first and all further append(ByteBuffer)
calls until length
bytes appended.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
append
(ByteBuffer dataBuffer) Appends bytes from given buffer.build()
Builds anIpcMessage
from all appended data.boolean
Returns if message is completed according to message checker.
-
Constructor Details
-
IpcMessageBuilder
public IpcMessageBuilder()
-
-
Method Details
-
append
Appends bytes from given buffer.On the first call, reads length of message from the first 4 bytes and appends minimum of remaining and
length
bytes. On further calls, appends min((length - already appended count),dataBuffer.remaining()
) bytes.isCompleted()
returnsfalse
untillength
bytes appended, then it returnstrue
.- Parameters:
dataBuffer
- given data buffer (notnull
)
-
isCompleted
public boolean isCompleted()Returns if message is completed according to message checker.Message is completed if and only if apended count of bytes, excluding the first 4 bytes of the first packet, is equal or greater then message length which read from the first 4 bytes of the first appended packet.
- Returns:
true
if message is completed,false
otherwise
-
build
Builds anIpcMessage
from all appended data.- Returns:
- built instance of
IpcMessage
(notnull
)
-