Created
March 4, 2024 20:45
-
-
Save charles-tan/5eb7155c07c21040a7cad34639e3cfd1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment