public static <T> T readVersionAndDeSerialize(SimpleVersionedSerializer<T> serializer, DataInputView in) throws IOException {
		checkNotNull(serializer, "serializer");
		checkNotNull(in, "in");

		final int version = in.readInt();
		final int length = in.readInt();
		final byte[] data = new byte[length];
		in.readFully(data);

		return serializer.deserialize(version, data);
	}
public static < T > T readVersionAndDeSerialize ( SimpleVersionedSerializer < T > serializer , DataInputView in ) throws IOException { checkNotNull ( serializer , "serializer" ) ; checkNotNull ( in , "in" ) ; final int version = in . readInt ( ) ; final int length = in . readInt ( ) ; final byte [ ] data = new byte [ length ] ; in . readFully ( data ) ; return serializer . deserialize ( version , data ) ; }
Deserializes the version and datum from a stream.

<p>This method deserializes data serialized via
{@link #writeVersionAndSerialize(SimpleVersionedSerializer, Object, DataOutputView)}.

<p>The first four bytes will be interpreted as the version. The next four bytes will be
interpreted as the length of the datum bytes, then length-many bytes will be read.
Finally, the datum is deserialized via the {@link SimpleVersionedSerializer#deserialize(int, byte[])}
method.

@param serializer The serializer to serialize the datum with.
@param in The stream to deserialize from.