@Override
  public void writeAFP(OutputStream os, AFPParserConfiguration config) throws IOException {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    for (MCC_RepeatingGroup rg : repeatingGroups) {
      rg.writeAFP(baos, config);
    }

    writeFullStructuredField(os, baos.toByteArray());
  }
 @Override
 public void decodeAFP(byte[] sfData, int offset, int length, AFPParserConfiguration config)
     throws AFPParserException {
   int actualLength = getActualLength(sfData, offset, length);
   int pos = 0;
   repeatingGroups = new ArrayList<MCC_MediumCopyCount.MCC_RepeatingGroup>();
   while (pos < actualLength) {
     MCC_RepeatingGroup rg = new MCC_RepeatingGroup();
     rg.decodeAFP(sfData, offset + pos, actualLength - pos, config);
     repeatingGroups.add(rg);
     pos += 6;
   }
 }