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
package TX_OtherClass;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.nio.ByteBuffer;
import zip.d;
public class p {
public static byte[] a_tobyte(RequestCommand arg7, long arg8) {
byte[] v0 = null;
byte[] v1 = ProtocolPackage.buildPostData(arg7);
if(v1 != null) {
int v2 = v1.length + 17;
ByteBuffer v3 = ByteBuffer.allocate(v2);
v3.put((byte) 38);
v3.putInt(v2);
v3.put((byte) 1);
v3.position(v3.position() + 10);
v3.put(v1);
v3.put((byte) 40);
v1 = v3.array();
ByteArrayOutputStream v2_1 = new ByteArrayOutputStream(v1.length + 50);
DataOutputStream v3_1 = new DataOutputStream(((OutputStream)v2_1));
int v4 = 19;
try {
v3_1.writeByte(v4);
v3_1.writeInt(0);
v3_1.writeShort(1);
v3_1.writeShort(65281);
v3_1.writeShort(arg7.head.cmdId);
v3_1.writeShort(0);
v3_1.writeLong(arg8);
v3_1.writeInt(531);
v3_1.writeInt(o.f());
v3_1.writeLong(0);
p.a(((OutputStream)v3_1), arg7.head.guid, 32);
v3_1.writeByte(o.g());
v3_1.writeInt(o.h());
p.a(((OutputStream)v3_1), null, 6);
v3_1.writeByte(0);
v3_1.writeShort(0);
v3_1.writeShort(0);
v3_1.writeInt(v1.length);
v1 = d.a(v1);
if(v1 == null) {
return v0;
}
v3_1.write(v1);
v3_1.writeByte(3);
v3_1.close();
v1 = v2_1.toByteArray();
ByteBuffer v2_2 = ByteBuffer.wrap(v1);
v2_2.putInt(1, v1.length);
v0 = v2_2.array();
}
catch(IOException v1_1) {
v1_1.printStackTrace();
}
}
return v0;
}
private static void a(OutputStream arg3, String arg4, int arg5) throws IOException {
int v0;
byte[] v2 = null;
if(arg5 > 0) {
if(arg4 != null) {
try {
v2 = arg4.getBytes("UTF-8");
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
v0 = v2.length;
}
else {
v2 = null;
v0 = 0;
}
if(v0 >= arg5) {
arg3.write(v2, 0, arg5);
return;
}
if(v0 > 0) {
arg3.write(v2, 0, v0);
}
while(v0 < arg5) {
arg3.write(0);
++v0;
}
}
}
}