nevado-jms/src/main/java/org/skyscreamer/nevado/jms/message/NevadoBytesMessage.java
/**
     * Writes an object to the bytes message stream.
     * <P>
     * This method works only for the objectified primitive object types (<code>Integer</code>,<code>Double</code>,
     * <code>Long</code> &nbsp;...), <code>String</code> objects, and byte arrays.
     *
     * @param value the object in the Java programming language ("Java object") to be written; it must not be null
     * @throws JMSException                   if the JMS provider fails to write the message due to some internal error.
     * @throws MessageFormatException         if the object is of an invalid type.
     * @throws MessageNotWriteableException   if the message is in read-only mode.
     * @throws java.lang.NullPointerException if the parameter <code>value</code> is null.
     */
Writes an object to the bytes message stream.

This method works only for the objectified primitive object types (Integer,Double,
Long  ...), String objects, and byte arrays.

@param value the object in the Java programming language ("Java object") to be written; it must not be null
@throws JMSException                   if the JMS provider fails to write the message due to some internal error.
@throws MessageFormatException         if the object is of an invalid type.
@throws MessageNotWriteableException   if the message is in read-only mode.
@throws java.lang.NullPointerException if the parameter value is null.
Writes an object to the bytes message stream . This method works only for the objectified primitive object types ( Integer Double Long ... ) String objects and byte arrays . @param value the object in the Java programming language ( " Java object " ) to be written ; it must not be null @throws JMSException if the JMS provider fails to write the message due to some internal error . @throws MessageFormatException if the object is of an invalid type . @throws MessageNotWriteableException if the message is in read - only mode . @throws java . lang . NullPointerException if the parameter value is null .
public void writeObject(Object value) throws JMSException {
        if (value == null) {
            throw new NullPointerException();
        }
        initializeWriting();
        if (value instanceof Boolean) {
            writeBoolean(((Boolean) value).booleanValue());
        }
        else if (value instanceof Character) {
            writeChar(((Character) value).charValue());
        }
        else if (value instanceof Byte) {
            writeByte(((Byte) value).byteValue());
        }
        else if (value instanceof Short) {
            writeShort(((Short) value).shortValue());
        }
        else if (value instanceof Integer) {
            writeInt(((Integer) value).intValue());
        }
        else if (value instanceof Double) {
            writeDouble(((Double) value).doubleValue());
        }
        else if (value instanceof Long) {
            writeLong(((Long) value).longValue());
        }
        else if (value instanceof Float) {
            writeFloat(((Float) value).floatValue());
        }
        else if (value instanceof Double) {
            writeDouble(((Double) value).doubleValue());
        }
        else if (value instanceof String) {
            writeUTF(value.toString());
        }
        else if (value instanceof byte[]) {
            writeBytes((byte[]) value);
        }
        else {
            throw new MessageFormatException("Cannot write non-primitive type:" + value.getClass());
        }
    }
public void writeObject ( Object value ) throws JMSException { if ( value == null ) { throw new NullPointerException ( ) ; } initializeWriting ( ) ; if ( value instanceof Boolean ) { writeBoolean ( ( ( Boolean ) value ) . booleanValue ( ) ) ; } else if ( value instanceof Character ) { writeChar ( ( ( Character ) value ) . charValue ( ) ) ; } else if ( value instanceof Byte ) { writeByte ( ( ( Byte ) value ) . byteValue ( ) ) ; } else if ( value instanceof Short ) { writeShort ( ( ( Short ) value ) . shortValue ( ) ) ; } else if ( value instanceof Integer ) { writeInt ( ( ( Integer ) value ) . intValue ( ) ) ; } else if ( value instanceof Double ) { writeDouble ( ( ( Double ) value ) . doubleValue ( ) ) ; } else if ( value instanceof Long ) { writeLong ( ( ( Long ) value ) . longValue ( ) ) ; } else if ( value instanceof Float ) { writeFloat ( ( ( Float ) value ) . floatValue ( ) ) ; } else if ( value instanceof Double ) { writeDouble ( ( ( Double ) value ) . doubleValue ( ) ) ; } else if ( value instanceof String ) { writeUTF ( value . toString ( ) ) ; } else if ( value instanceof byte [ ] ) { writeBytes ( ( byte [ ] ) value ) ; } else { throw new MessageFormatException ( "Cannot write non-primitive type:" + value . getClass ( ) ) ; } }
Writes an object to the bytes message stream.
Writes an object to the bytes message stream .