1 17 18 19 20 package org.apache.fop.render.afp.modca; 21 22 import java.io.IOException ; 23 import java.io.OutputStream ; 24 import org.apache.fop.render.afp.tools.BinaryUtils; 25 26 31 public class ObjectAreaDescriptor extends AbstractAFPObject { 32 33 private int _width = 0; 34 private int _height = 0; 35 36 42 public ObjectAreaDescriptor(int width, int height) { 43 44 _width = width; 45 _height = height; 46 47 } 48 49 54 public void writeDataStream(OutputStream os) 55 throws IOException { 56 57 byte[] data = new byte[] { 58 0x5A, 59 0x00, 0x1C, (byte) 0xD3, 62 (byte) 0xA6, 63 (byte) 0x6B, 64 0x00, 0x00, 0x00, 0x03, 0x43, 0x01, 0x08, 0x4B, 0x00, 0x00, 0x09, 0x60, 0x09, 0x60, 0x09, 0x4C, 0x02, 0x00, 0x00, 83 0x00, 84 0x00, 0x00, 86 0x00, 87 }; 88 89 byte[] l = BinaryUtils.convert(data.length - 1, 2); 90 data[1] = l[0]; 91 data[2] = l[1]; 92 93 byte[] x = BinaryUtils.convert(_width, 3); 94 data[23] = x[0]; 95 data[24] = x[1]; 96 data[25] = x[2]; 97 98 byte[] y = BinaryUtils.convert(_height, 3); 99 data[26] = y[0]; 100 data[27] = y[1]; 101 data[28] = y[2]; 102 103 os.write(data); 104 105 } 106 107 } | Popular Tags |