use of org.apache.qpid.proton.codec.CompositeReadableBuffer in project vertx-proton by vert-x3.
the class ProtonReceiverImpl method handlePartial.
private void handlePartial(final Receiver receiver, final Delivery delivery) {
if (sessionIncomingCapacity <= 0 || maxFrameSize <= 0 || session.getIncomingBytes() < windowFullThreshhold) {
// No window, or there is still capacity, so do nothing.
} else {
// room made for receiving more of the delivery.
if (delivery.available() > 0) {
ReadableBuffer buff = receiver.recv();
if (splitContent == null && buff instanceof CompositeReadableBuffer) {
// Its a composite and there is no prior partial content, use it.
splitContent = (CompositeReadableBuffer) buff;
} else {
int remaining = buff.remaining();
if (remaining > 0) {
if (splitContent == null) {
splitContent = new CompositeReadableBuffer();
}
byte[] chunk = new byte[remaining];
buff.get(chunk);
splitContent.append(chunk);
}
}
}
}
}
Aggregations