[buffer] Support JSON-serialized object as constructor parameter