CosObjectRef.java
2.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.adobe.internal.io.stream.OutputByteStream
*/
package com.adobe.internal.pdftoolkit.core.cos;
import com.adobe.internal.io.stream.OutputByteStream;
import com.adobe.internal.pdftoolkit.core.cos.CosDocument;
import com.adobe.internal.pdftoolkit.core.cos.CosObject;
import com.adobe.internal.pdftoolkit.core.cos.CosObjectInfo;
import com.adobe.internal.pdftoolkit.core.exceptions.PDFCosParseException;
import com.adobe.internal.pdftoolkit.core.exceptions.PDFIOException;
import com.adobe.internal.pdftoolkit.core.exceptions.PDFSecurityException;
import com.adobe.internal.pdftoolkit.core.util.StringOps;
import java.io.IOException;
class CosObjectRef
extends CosObject {
CosObjectRef(CosDocument doc, CosObjectInfo info) {
super(doc, null);
this.setInfo(info);
}
public int getType() {
return 8;
}
void writeOut(OutputByteStream outStream, boolean inString, boolean inDebugMode) throws PDFCosParseException, PDFIOException, PDFSecurityException, IOException {
CosObjectInfo info = this.getInfo();
int objNum = info.getObjNum();
outStream.write(StringOps.toByteArray(Integer.toString(objNum)));
outStream.write(32);
int objGen = info.getObjGen();
if (objGen != 0 && this.getDocument().willBeCompressed(objNum)) {
objGen = 0;
}
outStream.write(StringOps.toByteArray(Integer.toString(objGen)));
outStream.write(StringOps.toByteArray(" R"));
}
public Object getValue() throws PDFCosParseException, PDFIOException, PDFSecurityException {
CosObject obj;
try {
obj = this.getDocument().resolveReference(this);
}
catch (IOException e) {
throw new PDFIOException(e);
}
return obj.getValue();
}
public int getValueType() throws PDFCosParseException, PDFIOException, PDFSecurityException {
CosObject obj;
try {
obj = this.getDocument().resolveReference(this);
}
catch (IOException e) {
throw new PDFIOException(e);
}
return obj.getType();
}
public boolean equals(CosObject value) {
return value == this;
}
}