code: public static <T> void writeVersionAndSerialize(SimpleVersionedSerializer<T> serializer, T datum, DataOutputView out) throws IOException {
  		checkNotNull(serializer, "serializer");
  		checkNotNull(datum, "datum");
  		checkNotNull(out, "out");
  
  		final byte[] data = serializer.serialize(datum);
  
  		out.writeInt(serializer.getVersion());
  		out.writeInt(data.length);
  		out.write(data);
  	}
docs: Serializes the version and datum into a stream.
  
  <p>Data serialized via this method can be deserialized via
  {@link #readVersionAndDeSerialize(SimpleVersionedSerializer, DataInputView)}.
  
  <p>The first four bytes will be occupied by the version, as returned by
  {@link SimpleVersionedSerializer#getVersion()}. The remaining bytes will be the serialized
  datum, as produced by {@link SimpleVersionedSerializer#serialize(Object)}, plus its length.
  The resulting array will hence be eight bytes larger than the serialized datum.
  
  @param serializer The serializer to serialize the datum with.
  @param datum The datum to serialize.
  @param out The stream to serialize to.