PDFBOX-2207: use written length, as suggested by Simon Steiner

git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1610730 13f79535-47bb-0310-9956-ffa450edef68
PDFBOX-1961: don't flip annotations

git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1610735 13f79535-47bb-0310-9956-ffa450edef68