code: static void put(
          final AnnotationWriter[] panns,
          final int off,
          final ByteVector out)
      {
          int size = 1 + 2 * (panns.length - off);
          for (int i = off; i < panns.length; ++i) {
              size += panns[i] == null ? 0 : panns[i].getSize();
          }
          out.putInt(size).putByte(panns.length - off);
          for (int i = off; i < panns.length; ++i) {
              AnnotationWriter aw = panns[i];
              AnnotationWriter last = null;
              int n = 0;
              while (aw != null) {
                  ++n;
                  aw.visitEnd(); // in case user forgot to call visitEnd
                  aw.prev = last;
                  last = aw;
                  aw = aw.next;
              }
              out.putShort(n);
              aw = last;
              while (aw != null) {
                  out.putByteArray(aw.bv.data, 0, aw.bv.length);
                  aw = aw.prev;
              }
          }
      }
docs: Puts the given annotation lists into the given byte vector.
  
  @param panns an array of annotation writer lists.
  @param off index of the first annotation to be written.
  @param out where the annotations must be put.