code: private static void writeParam(Object v, DataOutput writer) throws IOException {
  		if (v instanceof Byte) {
  			writer.write(BYTE_ID);
  			writer.writeByte(((Byte) v).byteValue());
  		} else if (v instanceof Short) {
  			writer.write(SHORT_ID);
  			writer.writeShort(((Short) v).shortValue());
  		} else if (v instanceof Integer) {
  			writer.write(INTEGER_ID);
  			writer.writeInt(((Integer) v).intValue());
  		} else if (v instanceof Character) {
  			writer.write(CHAR_ID);
  			writer.writeChar(((Character) v).charValue());
  		} else if (v instanceof Long) {
  			writer.write(LONG_ID);
  			writer.writeLong(((Long) v).longValue());
  		} else if (v instanceof Float) {
  			writer.write(FLOAT_ID);
  			writer.writeFloat(((Float) v).floatValue());
  		} else if (v instanceof Double) {
  			writer.write(DOUBLE_ID);
  			writer.writeDouble(((Double) v).doubleValue());
  		} else if (v instanceof Date) {
  			writer.write(DATE_ID);
  			writer.writeLong(((Date) v).getTime());
  		} else if (v != null) {
  			writer.write(STRING_ID);
  			writeString(v.toString(), writer);
  		} else {
  			writer.write(NULL_ID);
  		}
  	}
docs: /*
  Serialize parameter Object. Need to take special care of {@link Number} and
  {@link Date} instances since they should be of the correct type for late binding.