< prev index next >

src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGBuffer.java

Print this page

        

*** 73,88 **** bufPtr = 0; this.iis = iis; } /** ! * Ensures that there are at least <code>count</code> bytes available * in the buffer, loading more data and moving any remaining * bytes to the front. A count of 0 means to just fill the buffer. * If the count is larger than the buffer size, just fills the buffer. * If the end of the stream is encountered before a non-0 count can ! * be satisfied, an <code>IIOException</code> is thrown with the * message "Image Format Error". */ void loadBuf(int count) throws IOException { if (debug) { System.out.print("loadbuf called with "); --- 73,88 ---- bufPtr = 0; this.iis = iis; } /** ! * Ensures that there are at least {@code count} bytes available * in the buffer, loading more data and moving any remaining * bytes to the front. A count of 0 means to just fill the buffer. * If the count is larger than the buffer size, just fills the buffer. * If the end of the stream is encountered before a non-0 count can ! * be satisfied, an {@code IIOException} is thrown with the * message "Image Format Error". */ void loadBuf(int count) throws IOException { if (debug) { System.out.print("loadbuf called with ");
*** 120,130 **** /** * Fills the data array from the stream, starting with * the buffer and then reading directly from the stream * if necessary. The buffer is left in an appropriate * state. If the end of the stream is encountered, an ! * <code>IIOException</code> is thrown with the * message "Image Format Error". */ void readData(byte [] data) throws IOException { int count = data.length; // First see what's left in the buffer. --- 120,130 ---- /** * Fills the data array from the stream, starting with * the buffer and then reading directly from the stream * if necessary. The buffer is left in an appropriate * state. If the end of the stream is encountered, an ! * {@code IIOException} is thrown with the * message "Image Format Error". */ void readData(byte [] data) throws IOException { int count = data.length; // First see what's left in the buffer.
*** 147,159 **** throw new IIOException ("Image format Error"); } } /** ! * Skips <code>count</code> bytes, leaving the buffer * in an appropriate state. If the end of the stream is ! * encountered, an <code>IIOException</code> is thrown with the * message "Image Format Error". */ void skipData(int count) throws IOException { // First see what's left in the buffer. if (bufAvail >= count) { // It's enough --- 147,159 ---- throw new IIOException ("Image format Error"); } } /** ! * Skips {@code count} bytes, leaving the buffer * in an appropriate state. If the end of the stream is ! * encountered, an {@code IIOException} is thrown with the * message "Image Format Error". */ void skipData(int count) throws IOException { // First see what's left in the buffer. if (bufAvail >= count) { // It's enough
*** 193,204 **** /** * Scan the buffer until the next 0xff byte, reloading * the buffer as necessary. The buffer position is left * pointing to the first non-0xff byte after a run of * 0xff bytes. If the end of the stream is encountered, ! * an EOI marker is inserted into the buffer and <code>true</code> ! * is returned. Otherwise returns <code>false</code>. */ boolean scanForFF(JPEGImageReader reader) throws IOException { boolean retval = false; boolean foundFF = false; while (foundFF == false) { --- 193,204 ---- /** * Scan the buffer until the next 0xff byte, reloading * the buffer as necessary. The buffer position is left * pointing to the first non-0xff byte after a run of * 0xff bytes. If the end of the stream is encountered, ! * an EOI marker is inserted into the buffer and {@code true} ! * is returned. Otherwise returns {@code false}. */ boolean scanForFF(JPEGImageReader reader) throws IOException { boolean retval = false; boolean foundFF = false; while (foundFF == false) {
< prev index next >