BinaryQTPComposer
.public class ByteArrayComposer extends BinaryQTPComposer
Use BinaryQTPComposer
instead. Note, that unlike this ByteArrayComposer
, you
have to specify an output to use with BinaryQTPComposer
using its
setOutput
method. The recommended choice of output is
ChunkedOutput
which takes byte arrays from a pool
and keeps a list of byte array
instead of reallocation and copying.
Modifier and Type | Field and Description |
---|---|
protected com.devexperts.io.ByteArrayOutput |
out
Deprecated.
|
protected byte[] |
pooledBuffer
Deprecated.
|
currentMessageType, msg, optSet, scheme, stats, writeEventTimeSequence, writeHeartbeat
VOID
Constructor and Description |
---|
ByteArrayComposer(DataScheme scheme)
Deprecated.
|
ByteArrayComposer(DataScheme scheme,
boolean describeRecords)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
boolean |
compose(MessageProvider provider,
QDStats stats)
Deprecated.
Composes message from the corresponding message provides and update IO bytes written in stats.
|
byte[] |
getBuffer()
Deprecated.
Returns byte array buffer where data is stored.
|
int |
getProcessed()
Deprecated.
Returns number of processed bytes ready to be sent over and removed.
|
boolean |
hasCapacity()
Deprecated.
Returns
true when the overall number of bytes composed had not exceeded the threshold yet. |
void |
removeBytes(int n)
Deprecated.
Removes specified number of bytes from the start of the buffer.
|
void |
removeBytes(int off,
int len)
Deprecated.
Removes specified number of bytes from a specified part of the buffer
from offset
off with a length of len . |
void |
setOutput(com.devexperts.io.BufferedOutput output)
Deprecated.
Changes output for the composed messages.
|
describeRecord, finishComposingMessage, getRequestedRecordDesc, isWideDecimalSupported, writeDescribeProtocolMessage, writeEmptyHeartbeatMessage, writeEventTimeSequence, writeField, writeHeartbeatMessage, writeHistorySubscriptionTime, writeIntField, writeMessageHeader, writeObjField, writeOtherMessageBody, writeRecordHeader, writeRecordPayload
abortMessageAndRethrow, append, beginMessage, beginRecord, compose, composeDescribeProtocol, composeEmptyHeartbeat, composeHeartbeatMessage, composeTimeProgressReport, endMessage, flush, getEventTimeSequence, getMessagePayloadSize, inMessage, resetSession, setOptSet, setStats, setWriteEventTimeSequence, setWriteHeartbeat, undoWriteMessageHeaderStateChange, visitData, visitDescribeProtocol, visitHeartbeat, visitIntField, visitObjField, visitOtherMessage, visitRecord, visitRecord, visitSubscription
visitHistoryAddSubscription, visitHistoryData, visitHistoryRemoveSubscription, visitStreamAddSubscription, visitStreamData, visitStreamRemoveSubscription, visitTickerAddSubscription, visitTickerData, visitTickerRemoveSubscription
protected byte[] pooledBuffer
protected com.devexperts.io.ByteArrayOutput out
public ByteArrayComposer(DataScheme scheme)
public ByteArrayComposer(DataScheme scheme, boolean describeRecords)
public void setOutput(com.devexperts.io.BufferedOutput output)
UnsupportedOperationException
.setOutput
in class AbstractQTPComposer
output
- output for the composed messages.public boolean hasCapacity()
true
when the overall number of bytes composed had not exceeded the threshold yet.hasCapacity
in interface DataVisitor
hasCapacity
in interface RecordSink
hasCapacity
in interface SubscriptionVisitor
hasCapacity
in class AbstractQTPComposer
public boolean compose(MessageProvider provider, QDStats stats)
public void removeBytes(int n)
removeBytes(0, n)
.n
- number of bytes to remove.IllegalArgumentException
- if specified number is negative
or is larger than the number of processed bytes.public void removeBytes(int off, int len)
off
with a length of len
.off
- offset of bytes to remove.len
- number of bytes to remove.IllegalArgumentException
- if off and/or len are out of valid range.public int getProcessed()
public byte[] getBuffer()
Note: the array instance used for buffering may change if new messages are added or previous ones are removed.
Copyright © 2002–2025 Devexperts LLC. All rights reserved.