     encoder = BinaryEncoder(forWritingInto: pointer)
   }
 
+  init(encoder: BinaryEncoder) {
+    self.encoder = encoder
+  }
+
   mutating func visitUnknown(bytes: Data) throws {
     encoder.appendUnknown(data: bytes)
   }


      encoder.putVarInt(value: Int64(WireFormat.MessageSet.Tags.message.rawValue))

      // Can force partial to true here because the parent message would have
      // already recursed for the isInitialized check if it was needed.
      let payload = try value.serializedData(partial: true)
      encoder.putBytesValue(value: payload)

      encoder.putVarInt(value: Int64(WireFormat.MessageSet.Tags.itemEnd.rawValue))
    }


  mutating func visitSingularMessageField<M: Message>(value: M,
                                             fieldNumber: Int) throws {
    encoder.startField(fieldNumber: fieldNumber, wireFormat: .lengthDelimited)
    let length = try value.serializedDataSize()
    encoder.putVarInt(value: length)
    try value.traverse(visitor: &self)
  }

  mutating func visitSingularGroupField<G: Message>(value: G, fieldNumber: Int) throws {
