code: private void writeTag() {
          if (dataPos == dataSize)
              return;
          int tag = data[dataPos++];
          if (isEOC(tag) && (data[dataPos] == 0)) {
              dataPos++;  // skip length
              writeTag();
          } else
              newData[newDataPos++] = (byte)tag;
      }
docs: Write the tag and if it is an end-of-contents tag
  then skip the tag and its 1 byte length of zero.