@Override public void saveToOutputStream(final OutputStream out) throws ActiveMQException { if (bodyBuffer != null) { // The body was rebuilt on the client, so we need to behave as a regular message on this case super.saveToOutputStream(out); } else { largeMessageController.saveBuffer(out); } }
private void checkBuffer() throws ActiveMQException { if (bodyBuffer == null) { long bodySize = this.largeMessageSize + BODY_OFFSET; if (bodySize > Integer.MAX_VALUE) { bodySize = Integer.MAX_VALUE; } createBody((int) bodySize); bodyBuffer = new ResetLimitWrappedActiveMQBuffer(BODY_OFFSET, buffer, this); largeMessageController.saveBuffer(new ActiveMQOutputStream(bodyBuffer)); } }