code: public static <T> byte[] serializeValue(T value, TypeSerializer<T> serializer) throws IOException {
  		if (value != null) {
  			// Serialize
  			DataOutputSerializer dos = new DataOutputSerializer(32);
  			serializer.serialize(value, dos);
  			return dos.getCopyOfBuffer();
  		} else {
  			return null;
  		}
  	}
docs: Serializes the value with the given serializer.
  
  @param value      Value of type T to serialize
  @param serializer Serializer for T
  @param <T>        Type of the value
  @return Serialized value or <code>null</code> if value <code>null</code>
  @throws IOException On failure during serialization