Transmit Java objects via a stream (e.g. a socket).