@ SuppressWarnings ( "unused" ) private boolean checkSwf ( ) throws IOException { //get rid of the last byte of the signature, the byte of the version and 4 bytes of the size byte [ ] a = new byte [ 6 ] ; if ( read ( a ) != a . length ) { return false ; } format = FORMAT_SWF ; int bitSize = ( int ) readUBits ( 5 ) ; int minX = ( int ) readSBits ( bitSize ) ; // unused, but necessary int maxX = ( int ) readSBits ( bitSize ) ; int minY = ( int ) readSBits ( bitSize ) ; // unused, but necessary int maxY = ( int ) readSBits ( bitSize ) ; width = maxX / 20 ; //cause we're in twips height = maxY / 20 ; //cause we're in twips setPhysicalWidthDpi ( 72 ) ; setPhysicalHeightDpi ( 72 ) ; return ( width > 0 && height > 0 ) ; }
Written by Michael Aird .