long pos = 0;
int read = 0;
while ((read = in.read(line)) > 0) {
for (int i = 0; i < read; ++i) {
while (!unseen.isEmpty() && unseen.peek().getPos() <= pos) {
SimpleAnnotation a = unseen.poll();
printAnnotationStart(out, a);
opened.push(a);
}
pos++;
out.append(String.format("%02X", line[i]));
out.append(' ');
while (!opened.isEmpty() && shouldClose(opened.peek(), pos)) {
SimpleAnnotation a = opened.pop();
printAnnotationEnd(out, a);
}
}
newLine(out);