1 50 51 package com.lowagie.text.rtf.document; 52 53 import java.io.ByteArrayOutputStream ; 54 import java.io.IOException ; 55 import java.io.OutputStream ; 56 57 import com.lowagie.text.rtf.RtfElement; 58 import com.lowagie.text.rtf.RtfExtendedElement; 59 60 68 public class RtfCodePage extends RtfElement implements RtfExtendedElement { 69 72 private static final byte[] ANSI = "\\ansi".getBytes(); 73 76 private static final byte[] ANSI_CODEPAGE = "\\ansicpg".getBytes(); 77 78 83 public RtfCodePage(RtfDocument doc) { 84 super(doc); 85 } 86 87 91 public byte[] write() 92 { 93 return(new byte[0]); 94 } 95 98 public void writeContent(final OutputStream out) throws IOException 99 { 100 } 101 102 108 public byte[] writeDefinition() { 109 ByteArrayOutputStream result = new ByteArrayOutputStream (); 110 try { 111 writeDefinition(result); 112 } catch(IOException ioe) { 113 ioe.printStackTrace(); 114 } 115 return result.toByteArray(); 116 } 117 118 121 public void writeDefinition(final OutputStream result) throws IOException 122 { 123 result.write(ANSI); 124 result.write(ANSI_CODEPAGE); 125 result.write(intToByteArray(1252)); 126 result.write((byte)'\n'); 127 } 128 129 } 130 | Popular Tags |