else if (value instanceof Byte)
outputStream.writeByte(((Byte) value).intValue());
else if (value instanceof byte[])
outputStream.write((byte[]) value);
else
throw new MessageFormatException("Can't write non Java primitive type"
+ " as a bytes array.");
} catch (IOException ioE) {
JMSException jE = new JMSException("Error while writing the value.");
jE.setLinkedException(ioE);
throw jE;