src/share/classes/javax/imageio/stream/ImageInputStreamImpl.java

Print this page
rev 9293 : 8034998: Fix raw and unchecked lint warnings in javax.imageio
Reviewed-by:

*** 41,53 **** * byte order interpretation, buffering, mark/reset, discarding, * closing, and disposing. */ public abstract class ImageInputStreamImpl implements ImageInputStream { ! private Stack markByteStack = new Stack(); ! private Stack markBitStack = new Stack(); private boolean isClosed = false; // Length of the buffer used for readFully(type[], int, int) private static final int BYTE_BUF_LENGTH = 8192; --- 41,53 ---- * byte order interpretation, buffering, mark/reset, discarding, * closing, and disposing. */ public abstract class ImageInputStreamImpl implements ImageInputStream { ! private Stack<Long> markByteStack = new Stack<>(); ! private Stack<Integer> markBitStack = new Stack<>(); private boolean isClosed = false; // Length of the buffer used for readFully(type[], int, int) private static final int BYTE_BUF_LENGTH = 8192;
*** 796,813 **** public void reset() throws IOException { if (markByteStack.empty()) { return; } ! long pos = ((Long)markByteStack.pop()).longValue(); if (pos < flushedPos) { throw new IIOException ("Previous marked position has been discarded!"); } seek(pos); ! int offset = ((Integer)markBitStack.pop()).intValue(); setBitOffset(offset); } public void flushBefore(long pos) throws IOException { checkClosed(); --- 796,813 ---- public void reset() throws IOException { if (markByteStack.empty()) { return; } ! long pos = markByteStack.pop().longValue(); if (pos < flushedPos) { throw new IIOException ("Previous marked position has been discarded!"); } seek(pos); ! int offset = markBitStack.pop().intValue(); setBitOffset(offset); } public void flushBefore(long pos) throws IOException { checkClosed();