pub fn write_frame<W, T>(w: &mut W, value: &T) -> Result<(), Error>where W: Write, T: Serialize,
Write a 4-byte big-endian length prefix followed by the JSON payload.