encode method

List<int> encode()

encode MetadataV2Body to bytes

Implementation

List<int> encode() {
  assert(body != null, 'Error: the body cant be empty.');
  if (body is MetadataV2p3Wrapper) {
    return _encodeMetadataV2p3(body as MetadataV2p3Wrapper);
  } else if (body is MetadataV2p4Wrapper) {
    return _encodeMetadataV2p4(body as MetadataV2p4Wrapper);
  }
  return [];
}