ByteArray input = (ByteArray) m;
if (input.empty()) {
return;
}
CompositeByteArray cumulation = this.cumulation;
// Avoid CompositeByteArray index overflow.
if (Integer.MAX_VALUE - cumulation.endIndex() < input.length()) {
CompositeByteArray newCumulation = new CompositeByteArray();
for (ByteArray component: cumulation) {
newCumulation.addLast(component);
}
this.cumulation = cumulation = newCumulation;
}
cumulation.addLast(input);