コード例 #1
0
 @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);
   }
 }
コード例 #2
0
  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));
    }
  }