public final void buildBodyFromBytes() throws IOException {
if (bodyAsBytes != null) {
//inflate bodyAsBytes if needed
if (ByteArrayCompression.isCompressed(bodyAsBytes)){
ByteArrayCompression compression = new ByteArrayCompression();
bodyAsBytes = compression.inflate(bodyAsBytes);
}
ByteArrayInputStream bytesIn = new ByteArrayInputStream(bodyAsBytes.getBuf(),bodyAsBytes.getOffset(),bodyAsBytes.getLength());
DataInputStream dataIn = new DataInputStream(bytesIn);
readBody(dataIn);
dataIn.close();