private void initializeReading() throws MessageNotReadableException {
if (!super.readOnlyMessage) {
throw new MessageNotReadableException("This message is in write-only mode");
}
try {
ByteArray data = super.getBodyAsBytes();
if (this.dataIn == null && data != null) {
if (ByteArrayCompression.isCompressed(data)){
ByteArrayCompression compression = new ByteArrayCompression();
data = compression.inflate(data);
}
ByteArrayInputStream bytesIn = new ByteArrayInputStream(data.getBuf(),data.getOffset(),data.getLength());
this.dataIn = new DataInputStream(bytesIn);
}
}
catch (IOException e) {
MessageNotReadableException mnr = new MessageNotReadableException("getBodyAsBytes failed");