< prev index next >

src/java.desktop/share/classes/sun/print/PSPrinterJob.java

Print this page

        

*** 945,955 **** /* Image data. */ int index = 0; byte[] rgbData = new byte[intSrcWidth * 3]; - try { /* Skip the parts of the image that are not part * of the source rectangle. */ index = (int) srcY * srcBitMapWidth; --- 945,954 ----
*** 970,982 **** /* * If there is an IOError we subvert it to a PrinterException. * Fix: There has got to be a better way, maybe define * a PrinterIOException and then throw that? */ ! } catch (IOException e) { //throw new PrinterException(e.toString()); ! } mPSStream.println(IMAGE_RESTORE); } /** --- 969,981 ---- /* * If there is an IOError we subvert it to a PrinterException. * Fix: There has got to be a better way, maybe define * a PrinterIOException and then throw that? */ ! //if (mPSStream.checkError()) { //throw new PrinterException(e.toString()); ! //} mPSStream.println(IMAGE_RESTORE); } /**
*** 1021,1041 **** /* Image data. */ int index = 0; byte[] rgbData = new byte[width*3]; - try { for(int i = 0; i < height; i++) { index = swapBGRtoRGB(bgrData, index, rgbData); byte[] encodedData = rlEncode(rgbData); byte[] asciiData = ascii85Encode(encodedData); mPSStream.write(asciiData); mPSStream.println(""); } ! } catch (IOException e) { ! throw new PrinterIOException(e); } mPSStream.println(IMAGE_RESTORE); } --- 1020,1039 ---- /* Image data. */ int index = 0; byte[] rgbData = new byte[width*3]; for(int i = 0; i < height; i++) { index = swapBGRtoRGB(bgrData, index, rgbData); byte[] encodedData = rlEncode(rgbData); byte[] asciiData = ascii85Encode(encodedData); mPSStream.write(asciiData); mPSStream.println(""); } ! if (mPSStream.checkError()) { ! throw new PrinterException("Error in PrintStream"); } mPSStream.println(IMAGE_RESTORE); }
< prev index next >