Example usage for com.rabbitmq.client.impl AMQContentHeader getBodySize

List of usage examples for com.rabbitmq.client.impl AMQContentHeader getBodySize

Introduction

In this page you can find the example usage for com.rabbitmq.client.impl AMQContentHeader getBodySize.

Prototype

public long getBodySize() 

Source Link

Usage

From source file:de.htwk_leipzig.bis.connection.handshake.clientRewrite.CommandAssembler.java

License:Mozilla Public License

public CommandAssembler(Method method, AMQContentHeader contentHeader, byte[] body) {
    this.method = method;
    this.contentHeader = contentHeader;
    this.bodyN = new ArrayList<byte[]>(2);
    this.bodyLength = 0;
    this.remainingBodyBytes = 0;
    appendBodyFragment(body);/*from  ww  w  .  java 2 s. c o  m*/
    if (method == null) {
        this.state = CAState.EXPECTING_METHOD;
    } else if (contentHeader == null) {
        this.state = method.hasContent() ? CAState.EXPECTING_CONTENT_HEADER : CAState.COMPLETE;
    } else {
        this.remainingBodyBytes = contentHeader.getBodySize() - this.bodyLength;
        updateContentBodyState();
    }
}