initializeWriting();
if (value == null) {
try {
MarshallingSupport.marshalNull(dataOut);
} catch (IOException ioe) {
throw new OpenwireException(ioe);
}
} else if (value instanceof String) {
writeString(value.toString());
} else if (value instanceof Character) {
writeChar(((Character)value).charValue());
} else if (value instanceof Boolean) {
writeBoolean(((Boolean)value).booleanValue());
} 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 Float) {
writeFloat(((Float)value).floatValue());
} else if (value instanceof Double) {
writeDouble(((Double)value).doubleValue());
} else if (value instanceof byte[]) {
writeBytes((byte[])value);
}else if (value instanceof Long) {
writeLong(((Long)value).longValue());
}else {
throw new OpenwireException("Unsupported Object type: " + value.getClass());
}
}