< prev index next >

src/java.desktop/share/classes/sun/awt/image/PNGImageDecoder.java

Print this page

        

*** 87,97 **** properties.put(key,value); } private void property(String key,float value) { property(key, Float.valueOf(value)); } ! private final void pngassert(boolean b) throws IOException { if(!b) { PNGException e = new PNGException("Broken file"); e.printStackTrace(); throw e; } --- 87,97 ---- properties.put(key,value); } private void property(String key,float value) { property(key, Float.valueOf(value)); } ! private void pngassert(boolean b) throws IOException { if(!b) { PNGException e = new PNGException("Broken file"); e.printStackTrace(); throw e; }
*** 690,713 **** pos = 0; inbuf = nin; fill(); return limit-pos>=n; } ! private final int getInt(int pos) { return ((inbuf[pos ]&0xFF)<<24) | ((inbuf[pos+1]&0xFF)<<16) | ((inbuf[pos+2]&0xFF)<< 8) | ((inbuf[pos+3]&0xFF) ); } ! private final int getShort(int pos) { return (short)(((inbuf[pos ]&0xFF)<<8) | ((inbuf[pos+1]&0xFF) )); } ! private final int getByte(int pos) { return inbuf[pos]&0xFF; } ! private final boolean getChunk() throws IOException { chunkLength = 0; if (!need(8)) return false; chunkLength = getInt(pos); chunkKey = getInt(pos+4); if(chunkLength<0) throw new PNGException("bogus length: "+chunkLength); --- 690,713 ---- pos = 0; inbuf = nin; fill(); return limit-pos>=n; } ! private int getInt(int pos) { return ((inbuf[pos ]&0xFF)<<24) | ((inbuf[pos+1]&0xFF)<<16) | ((inbuf[pos+2]&0xFF)<< 8) | ((inbuf[pos+3]&0xFF) ); } ! private int getShort(int pos) { return (short)(((inbuf[pos ]&0xFF)<<8) | ((inbuf[pos+1]&0xFF) )); } ! private int getByte(int pos) { return inbuf[pos]&0xFF; } ! private boolean getChunk() throws IOException { chunkLength = 0; if (!need(8)) return false; chunkLength = getInt(pos); chunkKey = getInt(pos+4); if(chunkLength<0) throw new PNGException("bogus length: "+chunkLength);
< prev index next >