IppImageAnchorRandomAccessUrl.java
8.18 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
/*
* Decompiled with CFR 0_118.
*/
package com.scene7.is.ipp.messages;
import com.scene7.is.ipp.messages.Ipp;
import com.scene7.is.ipp.messages.IppByte;
import com.scene7.is.ipp.messages.IppImageAnchor;
import com.scene7.is.ipp.messages.IppImageAnchorAssetType;
import com.scene7.is.ipp.messages.IppImageAnchorType;
import com.scene7.is.ipp.messages.IppInt;
import com.scene7.is.ipp.messages.IppLongString;
import com.scene7.is.ipp.messages.Offset;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.io.Writer;
public class IppImageAnchorRandomAccessUrl
extends IppImageAnchor {
private String url_;
private String username_;
private String password_;
private String[] httpHeaderName_;
private String[] httpHeaderValue_;
private int assetType_;
public IppImageAnchorRandomAccessUrl(String url, String username, String password, String[] httpHeaderName, String[] httpHeaderValue, int assetType) {
this.url_ = url;
this.username_ = username;
this.password_ = password;
this.httpHeaderName_ = httpHeaderName;
this.httpHeaderValue_ = httpHeaderValue;
this.assetType_ = assetType;
}
public String toString() {
StringBuffer buffer = new StringBuffer();
buffer.append("[");
buffer.append("url: ").append(String.valueOf(this.url_)).append(" ");
buffer.append("username: ").append(String.valueOf(this.username_)).append(" ");
buffer.append("password: ").append(String.valueOf(this.password_)).append(" ");
buffer.append("httpHeaderName: ").append(String.valueOf(this.httpHeaderName_)).append(" ");
buffer.append("httpHeaderValue: ").append(String.valueOf(this.httpHeaderValue_)).append(" ");
buffer.append("assetType: ").append(String.valueOf(this.assetType_)).append(" ");
buffer.append("]");
return buffer.toString();
}
public boolean equals(Object o) {
int i;
if (!(o instanceof IppImageAnchorRandomAccessUrl)) {
return false;
}
IppImageAnchorRandomAccessUrl e = (IppImageAnchorRandomAccessUrl)o;
if (!this.url_.equals(e.url_)) {
return false;
}
if (!this.username_.equals(e.username_)) {
return false;
}
if (!this.password_.equals(e.password_)) {
return false;
}
if (this.httpHeaderName_.length != e.httpHeaderName_.length) {
return false;
}
for (i = 0; i < this.httpHeaderName_.length; ++i) {
if (this.httpHeaderName_[i].equals(e.httpHeaderName_[i])) continue;
return false;
}
if (this.httpHeaderValue_.length != e.httpHeaderValue_.length) {
return false;
}
for (i = 0; i < this.httpHeaderValue_.length; ++i) {
if (this.httpHeaderValue_[i].equals(e.httpHeaderValue_[i])) continue;
return false;
}
if (this.assetType_ != e.assetType_) {
return false;
}
return true;
}
public static IppImageAnchorRandomAccessUrl UnstuffDerived(byte[] arr, Offset arrayPos) {
Ipp.Assert((arrayPos.val & 3) == 0, "IppImageAnchorRandomAccessUrl align");
int type = IppInt.Unstuff(arr, arrayPos);
String url = IppLongString.Unstuff(arr, arrayPos);
String username = IppLongString.Unstuff(arr, arrayPos);
String password = IppLongString.Unstuff(arr, arrayPos);
String[] httpHeaderName = IppLongString.UnstuffArray(arr, arrayPos);
String[] httpHeaderValue = IppLongString.UnstuffArray(arr, arrayPos);
int assetType = IppInt.Unstuff(arr, arrayPos);
IppByte.UnstuffFixedArray(arr, arrayPos, 4);
Ipp.Assert(type == 65549, "IppImageAnchorRandomAccessUrl enum id");
return new IppImageAnchorRandomAccessUrl(url, username, password, httpHeaderName, httpHeaderValue, assetType);
}
public static void StuffDerived(byte[] arr, Offset arrayPos, Offset varPos, IppImageAnchorRandomAccessUrl val) {
Ipp.Assert((arrayPos.val & 3) == 0, "IppImageAnchorRandomAccessUrl align");
if (val != null) {
IppInt.Stuff(arr, arrayPos, varPos, val.type());
IppLongString.Stuff(arr, arrayPos, varPos, val.url());
IppLongString.Stuff(arr, arrayPos, varPos, val.username());
IppLongString.Stuff(arr, arrayPos, varPos, val.password());
IppLongString.StuffArray(arr, arrayPos, varPos, val.httpHeaderName());
IppLongString.StuffArray(arr, arrayPos, varPos, val.httpHeaderValue());
IppInt.Stuff(arr, arrayPos, varPos, val.assetType());
Ipp.StuffNullBytes(arr, arrayPos, 4);
} else {
Ipp.StuffNullBytes(arr, arrayPos, 48);
}
}
public static void Print(Writer tf, String label, IppImageAnchorRandomAccessUrl it) throws IOException {
String ll = label + "IppImageAnchorRandomAccessUrl: ";
if (it == null) {
tf.write(ll + "NULL!!\n");
return;
}
tf.write(ll + "\n");
IppImageAnchorType.Print(tf, ll + "type: ", it.type());
IppLongString.Print(tf, ll + "url: ", it.url());
IppLongString.Print(tf, ll + "username: ", it.username());
IppLongString.Print(tf, ll + "password: ", it.password());
IppLongString.PrintArray(tf, ll + "httpHeaderName: ", it.httpHeaderName());
IppLongString.PrintArray(tf, ll + "httpHeaderValue: ", it.httpHeaderValue());
IppImageAnchorAssetType.Print(tf, ll + "assetType: ", it.assetType());
}
public static void PrintArray(Writer tf, String label, IppImageAnchorRandomAccessUrl[] it) throws IOException {
String ll = label + "IppImageAnchorRandomAccessUrl Array, length: ";
tf.write(ll);
if (it == null) {
tf.write("NULL!!!\n");
return;
}
tf.write("" + it.length + "\n");
for (int i = 0; i < it.length; ++i) {
ll = label + "IppImageAnchorRandomAccessUrl[" + String.valueOf(i) + "]: ";
IppImageAnchorRandomAccessUrl.Print(tf, ll, it[i]);
}
}
public void adjustVarPos(Offset varPos) {
int i;
try {
varPos.val += this.url_.getBytes("UTF-8").length + 1;
}
catch (UnsupportedEncodingException e) {
throw new AssertionError(e);
}
try {
varPos.val += this.username_.getBytes("UTF-8").length + 1;
}
catch (UnsupportedEncodingException e) {
throw new AssertionError(e);
}
try {
varPos.val += this.password_.getBytes("UTF-8").length + 1;
}
catch (UnsupportedEncodingException e) {
throw new AssertionError(e);
}
if (this.httpHeaderName_ != null) {
varPos.val = varPos.val + 3 & -4;
varPos.val += this.httpHeaderName_.length * 4;
for (i = 0; i < this.httpHeaderName_.length; ++i) {
try {
varPos.val += this.httpHeaderName_[i].getBytes("UTF-8").length + 1;
continue;
}
catch (UnsupportedEncodingException e) {
throw new AssertionError(e);
}
}
}
if (this.httpHeaderValue_ != null) {
varPos.val = varPos.val + 3 & -4;
varPos.val += this.httpHeaderValue_.length * 4;
for (i = 0; i < this.httpHeaderValue_.length; ++i) {
try {
varPos.val += this.httpHeaderValue_[i].getBytes("UTF-8").length + 1;
continue;
}
catch (UnsupportedEncodingException e) {
throw new AssertionError(e);
}
}
}
}
public int type() {
return 65549;
}
public String url() {
return this.url_;
}
public String username() {
return this.username_;
}
public String password() {
return this.password_;
}
public String[] httpHeaderName() {
return this.httpHeaderName_;
}
public String[] httpHeaderValue() {
return this.httpHeaderValue_;
}
public int assetType() {
return this.assetType_;
}
}