Utf8.java
3.93 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
package com.google.common.base;
import com.google.common.annotations.Beta;
import com.google.common.annotations.GwtCompatible;
@Beta
@GwtCompatible
public final class Utf8
{
public static int encodedLength(CharSequence paramCharSequence)
{
int k = 0;
int n = paramCharSequence.length();
int j = 0;
while ((j < n) && (paramCharSequence.charAt(j) < '')) {
j += 1;
}
for (;;)
{
int i;
if (j < n)
{
int m = paramCharSequence.charAt(j);
if (m < 2048)
{
i += (127 - m >>> 31);
j += 1;
}
else
{
int i2 = paramCharSequence.length();
if (j < i2)
{
int i3 = paramCharSequence.charAt(j);
if (i3 < 2048)
{
k += (127 - i3 >>> 31);
m = j;
}
for (;;)
{
j = m + 1;
break;
int i1 = k + 2;
k = i1;
m = j;
if (55296 <= i3)
{
k = i1;
m = j;
if (i3 <= 57343)
{
if (Character.codePointAt(paramCharSequence, j) < 65536) {
throw new IllegalArgumentException(39 + "Unpaired surrogate at index " + j);
}
m = j + 1;
k = i1;
}
}
}
}
i = k + i;
}
}
else
{
for (;;)
{
if (i < n)
{
long l = i;
throw new IllegalArgumentException(54 + "UTF-8 length does not fit in int: " + (l + 4294967296L));
}
return i;
}
i = n;
}
}
}
public static boolean isWellFormed(byte[] paramArrayOfByte)
{
return isWellFormed(paramArrayOfByte, 0, paramArrayOfByte.length);
}
public static boolean isWellFormed(byte[] paramArrayOfByte, int paramInt1, int paramInt2)
{
int i = paramInt1 + paramInt2;
Preconditions.checkPositionIndexes(paramInt1, i, paramArrayOfByte.length);
if (paramInt1 < i) {
if (paramArrayOfByte[paramInt1] >= 0) {}
}
for (;;)
{
if (paramInt1 >= i) {
return true;
}
paramInt2 = paramInt1 + 1;
paramInt1 = paramArrayOfByte[paramInt1];
if (paramInt1 < 0)
{
if (paramInt1 < -32)
{
if (paramInt2 == i) {
return false;
}
if (paramInt1 >= -62)
{
paramInt1 = paramInt2 + 1;
if (paramArrayOfByte[paramInt2] <= -65) {
continue;
}
}
return false;
}
if (paramInt1 < -16)
{
if (paramInt2 + 1 >= i) {
return false;
}
j = paramInt2 + 1;
paramInt2 = paramArrayOfByte[paramInt2];
if ((paramInt2 <= -65) && ((paramInt1 != -32) || (paramInt2 >= -96)) && ((paramInt1 != -19) || (-96 > paramInt2)))
{
paramInt1 = j + 1;
if (paramArrayOfByte[j] <= -65) {
continue;
}
}
return false;
}
if (paramInt2 + 2 >= i) {
return false;
}
int j = paramInt2 + 1;
paramInt2 = paramArrayOfByte[paramInt2];
if ((paramInt2 <= -65) && ((paramInt1 << 28) + (paramInt2 + 112) >> 30 == 0))
{
paramInt2 = j + 1;
if (paramArrayOfByte[j] <= -65)
{
paramInt1 = paramInt2 + 1;
if (paramArrayOfByte[paramInt2] <= -65) {
continue;
}
}
}
return false;
paramInt1 += 1;
break;
return true;
}
paramInt1 = paramInt2;
}
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/google/common/base/Utf8.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/