01: package com.etymon.pj.object.pagemark;
02:
03: import java.io.*;
04: import java.util.*;
05: import com.etymon.pj.object.*;
06:
07: /**
08: Image operator: EI.
09: @author Nassib Nassar
10: */
11: public class XEI extends PageMarkOperator {
12:
13: public XEI(PjDictionary properties, byte[] imageData) {
14: _properties = properties;
15: _imageData = imageData;
16: }
17:
18: public PjDictionary getProperties() {
19: return _properties;
20: }
21:
22: public byte[] getImageData() {
23: return _imageData;
24: }
25:
26: public long writePdf(OutputStream os) throws IOException {
27: long z = writeln(os, "BI");
28: z = z + _properties.writePdf(os);
29: z = z + write(os, "ID ");
30: z = z + write(os, _imageData);
31: z = z + writeln(os, "EI");
32: return z;
33: }
34:
35: /**
36: Returns a deep copy of this object.
37: @return a deep copy of this object.
38: */
39: public Object clone() {
40: // may need to be changed since we've added image data
41: return this ;
42: }
43:
44: public boolean equals(Object obj) {
45: // may need to be changed since we've added image data
46: if (obj == null) {
47: return false;
48: }
49: if (obj instanceof XEI) {
50: return (_properties.equals(((XEI) obj)._properties));
51: } else {
52: return false;
53: }
54: }
55:
56: private PjDictionary _properties;
57: private byte[] _imageData;
58:
59: }
|