Index: sources/org/apache/batik/transcoder/wmf/tosvg/AbstractWMFReader.java =================================================================== --- sources/org/apache/batik/transcoder/wmf/tosvg/AbstractWMFReader.java (revision 532555) +++ sources/org/apache/batik/transcoder/wmf/tosvg/AbstractWMFReader.java (working copy) @@ -24,7 +24,6 @@ import java.awt.geom.Rectangle2D; import java.io.DataInputStream; import java.io.IOException; -import java.io.InputStream; import java.util.List; import java.util.ArrayList; @@ -76,27 +75,13 @@ } /** - * ALWAYS expect to get less than the requested number of bytes from a read(). - * @param buff is filled from is - * @param is inputStream - * @throws IOException from is.read() - */ - private void fillBytes( byte[] buff, InputStream is ) throws IOException { - int expected = buff.length; - int nRead = 0; - do{ - nRead += is.read( buff, nRead, expected - nRead ); - } while ( nRead < expected ); - } - - /** * Read the next short ( 2 bytes) value in the DataInputStream. * we cant use is.readShort() because of different byte-order. */ protected short readShort( DataInputStream is ) throws IOException { byte[] js = new byte[ 2 ]; - fillBytes( js, is ); + is.readFully( js ); return (short) (((js[ 1 ] << 8)) & 0xff00 | (js[0] & 0x00ff)); } @@ -108,7 +93,7 @@ protected int readInt( DataInputStream is ) throws IOException { byte[] js = new byte[ 4 ]; - fillBytes( js, is ); + is.readFully( js ); return ( 0xff & js[ 3 ] ) << 24 | ( 0xff & js[ 2 ] ) << 16