IppByte.java
1.71 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
/*
* Decompiled with CFR 0_118.
*/
package com.scene7.is.ipp.messages;
import com.scene7.is.ipp.messages.Ipp;
import com.scene7.is.ipp.messages.Offset;
import java.io.IOException;
import java.io.Writer;
public class IppByte {
public IppByte() {
Ipp.Assert(false, "IppByte ctor");
}
public static byte Unstuff(byte[] arr, Offset arrayPos) {
int pos = arrayPos.val++;
return arr[pos];
}
public static byte[] UnstuffFixedArray(byte[] arr, Offset arrayPos, int count) {
byte[] result = new byte[count];
System.arraycopy(arr, arrayPos.val, result, 0, count);
arrayPos.val += count;
return result;
}
public static void Stuff(byte[] arr, Offset arrayPos, Offset varPos, byte val) {
arr[arrayPos.val] = val;
++arrayPos.val;
}
public static void StuffFixedArray(byte[] arr, Offset arrayPos, Offset varPos, int count, byte[] val) {
Ipp.Assert(count == val.length, "IppByte count");
System.arraycopy(val, 0, arr, arrayPos.val, count);
arrayPos.val += count;
}
public static void Print(Writer tf, String label, byte it) throws IOException {
String ll = label + "IppByte: ";
tf.write(ll);
tf.write("" + it + "\n");
}
public static void PrintArray(Writer tf, String label, byte[] it) throws IOException {
String ll = label + "IppByte 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 + "IppByte[" + String.valueOf(i) + "]: ";
IppByte.Print(tf, ll, it[i]);
}
}
}