static internal void put(AnnotationWriter[] panns, int off, 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(); 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; } } }
internal void put(ByteVector @out) { int n = 0; int size = 2; AnnotationWriter aw = this; AnnotationWriter last = null; while (aw != null) { ++n; size += aw.bv.length; aw.visitEnd(); aw.prev = last; last = aw; aw = aw.next; } @out.putInt(size); @out.putShort(n); aw = last; while (aw != null) { @out.putByteArray(aw.bv.data, 0, aw.bv.length); aw = aw.prev; } }