try { msg.readBoolean(); fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
assertEquals(123,msg.readInt());
// Byte
msg = new StreamMessageImpl();
msg.writeInt(123);
msg.markAsReadOnly();
try { msg.readByte(); fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
assertEquals(123,msg.readInt());
// Short