Serialize streams with properties. Call function ensureProperties() to
ensure that stream properties are available.