we have util methods for this now see `writeOptionalStreamable` / `readOptionalStreamable`