1 51 package org.apache.fop.render.pcl; 52 53 import java.io.*; 54 55 public class PCLStream { 56 OutputStream out = null; 57 boolean doOutput = true; 58 59 public PCLStream(OutputStream os) { 60 out = os; 61 } 62 63 public void add(String str) { 64 if (!doOutput) 65 return; 66 67 byte buff[] = new byte[str.length()]; 68 int countr; 69 int len = str.length(); 70 for (countr = 0; countr < len; countr++) 71 buff[countr] = (byte)str.charAt(countr); 72 try { 73 out.write(buff); 74 } catch (IOException e) { 75 throw new RuntimeException (e.toString()); 78 } 79 } 80 81 public void setDoOutput(boolean doout) { 82 doOutput = doout; 83 } 84 85 } 86 | Popular Tags |