3445N/A * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. 3445N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3445N/A * This code is free software; you can redistribute it and/or modify it 3445N/A * under the terms of the GNU General Public License version 2 only, as 3445N/A * published by the Free Software Foundation. 3445N/A * This code is distributed in the hope that it will be useful, but WITHOUT 3445N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 3445N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 3445N/A * version 2 for more details (a copy is included in the LICENSE file that 3445N/A * You should have received a copy of the GNU General Public License version 3445N/A * 2 along with this work; if not, write to the Free Software Foundation, 3445N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 3445N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 3445N/A * or visit www.oracle.com if you need additional information or have any 3445N/A * @summary REG: Printing an Image using image/gif doc flavor crashes the VM, Solsparc 3445N/A * @run main/othervm -Xcomp -XX:CompileOnly="Test6732154::ascii85Encode" Test6732154 3445N/A // Exact copy of sun.print.PSPrinterJob.ascii85Encode([b)[b 3445N/A // input not a multiple of 4 bytes, write partial output. 3445N/A for (
int b =
0; b < n+
1 ; b++) {
3445N/A /* The original intention was to insert a newline after every 78 bytes. 3445N/A * This was mainly intended for legibility but I decided against this 3445N/A * partially because of the (small) amount of extra space, and 3445N/A * partially because for line breaks either would have to hardwire 3445N/A * ascii 10 (newline) or calculate space in bytes to allocate for 3445N/A * the platform's newline byte sequence. Also need to be careful 3445N/A * about where its inserted: 3445N/A * Ascii 85 decoder ignores white space except for one special case: 3445N/A * you must ensure you do not split the EOD marker across lines.