Ejemplo n.º 1
0
  public synchronized HornetQBuffer getBodyBufferCopy() {
    // Must copy buffer before sending it

    HornetQBuffer newBuffer = buffer.copy(0, buffer.capacity());

    newBuffer.setIndex(0, getEndOfBodyPosition());

    return new ResetLimitWrappedHornetQBuffer(BODY_OFFSET, newBuffer, null);
  }
Ejemplo n.º 2
0
  private void forceCopy() {
    // Must copy buffer before sending it

    buffer = buffer.copy(0, buffer.capacity());

    buffer.setIndex(0, getEndOfBodyPosition());

    if (bodyBuffer != null) {
      bodyBuffer.setBuffer(buffer);
    }

    bufferUsed = false;
  }
Ejemplo n.º 3
0
  public synchronized HornetQBuffer getEncodedBuffer() {
    HornetQBuffer buff = encodeToBuffer();

    if (bufferUsed) {
      HornetQBuffer copied = buff.copy(0, buff.capacity());

      copied.setIndex(0, endOfMessagePosition);

      return copied;
    } else {
      buffer.setIndex(0, endOfMessagePosition);

      bufferUsed = true;

      return buffer;
    }
  }