WritableAnnotation [] annotations = new WritableAnnotation [ 2 ]; annotations [ 0 ] = new SquareAnnotation ( 1 , 10 , 10 , 100 , 100 ); annotations [ 1 ] = new CircleAnnotation ( 2 , 10 , 10 , 100 , 100 ); AnnotationWriter . writeAnnotations ( inputFile , outputFile , annotation );