// Short
msg = new StreamMessageImpl();
msg.writeString("foobar");
msg.markAsReadOnly();
try { msg.readShort(); fail("Should have failed"); } catch (NumberFormatException e) { /* OK */ }
assertEquals("foobar",msg.readString());
// Char
msg = new StreamMessageImpl();
msg.writeString("foobar");
msg.markAsReadOnly();