byte[] bytes = null;
ByteArrayOutputStream dout = new ByteArrayOutputStream();
DataOutputStream output = new DataOutputStream(dout);
try {
if (value instanceof Double) {
output.writeDouble(value.doubleValue());
} else if (value instanceof Float) {
output.writeFloat(value.floatValue());
} else if (value instanceof Integer) {
output.writeInt(value.intValue());
} else if (value instanceof Short) {