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 ; } } }
Puts the given annotation lists into the given byte vector .