Added Java serialization util functions back in network/common/util/JavaUtils

Yeah pretty standard formulation. Nit suggestion: don't throw general `RuntimeException` but something marginally more specific like `IllegalStateException`.