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 java.io.UnsupportedEncodingException ; 25 26 import org.apache.fop.render.afp.tools.BinaryUtils; 27 28 44 public class IncludePageSegment extends AbstractNamedAFPObject{ 45 46 49 private byte [] _xCoor; 50 51 54 private byte [] _yCoor; 55 56 62 public IncludePageSegment(String name, int xVal, int yVal){ 63 64 super(name); 65 _xCoor = BinaryUtils.convert(xVal, 3); 66 _yCoor = BinaryUtils.convert(yVal, 3); 67 68 } 69 70 75 public void writeDataStream(OutputStream os) 76 throws IOException { 77 78 byte[] data = new byte[23]; 80 data[0] = 0x5A; 81 82 byte[] rl1 = BinaryUtils.convert(22, 2); data[1] = rl1[0]; 85 data[2] = rl1[1]; 86 87 data[3] = (byte) 0xD3; 89 data[4] = (byte) 0xAF; 90 data[5] = (byte) 0x5F; 91 92 data[6] = 0x00; data[7] = 0x00; data[8] = 0x00; 96 for (int i = 0; i < _nameBytes.length; i++) { 97 98 data[9 + i] = _nameBytes[i]; 99 100 } 101 102 data[17] = _xCoor[0]; data[18] = _xCoor[1]; 104 data[19] = _xCoor[2]; 105 106 data[20] = _yCoor[0]; data[21] = _yCoor[1]; 108 data[22] = _yCoor[2]; 109 110 os.write(data); 111 112 } 113 114 115 } 116 | Popular Tags |