UnsignedBytes.java
4.21 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
package com.google.common.primitives;
import com.google.common.annotations.Beta;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;
import java.util.Comparator;
public final class UnsignedBytes
{
public static final byte MAX_POWER_OF_TWO = -128;
public static final byte MAX_VALUE = -1;
@VisibleForTesting
static Comparator<byte[]> a()
{
return UnsignedBytes.a.a.a;
}
public static byte checkedCast(long paramLong)
{
if (paramLong >> 8 != 0L) {
throw new IllegalArgumentException(34 + "Out of range: " + paramLong);
}
return (byte)(int)paramLong;
}
public static int compare(byte paramByte1, byte paramByte2)
{
return toInt(paramByte1) - toInt(paramByte2);
}
public static String join(String paramString, byte... paramVarArgs)
{
Preconditions.checkNotNull(paramString);
if (paramVarArgs.length == 0) {
return "";
}
StringBuilder localStringBuilder = new StringBuilder(paramVarArgs.length * (paramString.length() + 3));
localStringBuilder.append(toInt(paramVarArgs[0]));
int i = 1;
while (i < paramVarArgs.length)
{
localStringBuilder.append(paramString).append(toString(paramVarArgs[i]));
i += 1;
}
return localStringBuilder.toString();
}
public static Comparator<byte[]> lexicographicalComparator()
{
return a.b;
}
public static byte max(byte... paramVarArgs)
{
int i = 1;
if (paramVarArgs.length > 0) {}
int j;
for (boolean bool = true;; bool = false)
{
Preconditions.checkArgument(bool);
int k;
for (j = toInt(paramVarArgs[0]); i < paramVarArgs.length; j = k)
{
int m = toInt(paramVarArgs[i]);
k = j;
if (m > j) {
k = m;
}
i += 1;
}
}
return (byte)j;
}
public static byte min(byte... paramVarArgs)
{
int i = 1;
if (paramVarArgs.length > 0) {}
int j;
for (boolean bool = true;; bool = false)
{
Preconditions.checkArgument(bool);
int k;
for (j = toInt(paramVarArgs[0]); i < paramVarArgs.length; j = k)
{
int m = toInt(paramVarArgs[i]);
k = j;
if (m < j) {
k = m;
}
i += 1;
}
}
return (byte)j;
}
@Beta
public static byte parseUnsignedByte(String paramString)
{
return parseUnsignedByte(paramString, 10);
}
@Beta
public static byte parseUnsignedByte(String paramString, int paramInt)
{
paramInt = Integer.parseInt((String)Preconditions.checkNotNull(paramString), paramInt);
if (paramInt >> 8 == 0) {
return (byte)paramInt;
}
throw new NumberFormatException(25 + "out of range: " + paramInt);
}
public static byte saturatedCast(long paramLong)
{
if (paramLong > toInt((byte)-1)) {
return -1;
}
if (paramLong < 0L) {
return 0;
}
return (byte)(int)paramLong;
}
public static int toInt(byte paramByte)
{
return paramByte & 0xFF;
}
@Beta
public static String toString(byte paramByte)
{
return toString(paramByte, 10);
}
@Beta
public static String toString(byte paramByte, int paramInt)
{
if ((paramInt >= 2) && (paramInt <= 36)) {}
for (boolean bool = true;; bool = false)
{
Preconditions.checkArgument(bool, "radix (%s) must be between Character.MIN_RADIX and Character.MAX_RADIX", new Object[] { Integer.valueOf(paramInt) });
return Integer.toString(toInt(paramByte), paramInt);
}
}
@VisibleForTesting
static class a
{
static final String a = String.valueOf(a.class.getName()).concat("$UnsafeComparator");
static final Comparator<byte[]> b = a();
private static Comparator<byte[]> a()
{
try
{
Comparator localComparator = (Comparator)Class.forName(a).getEnumConstants()[0];
return localComparator;
}
catch (Throwable localThrowable) {}
return UnsignedBytes.a();
}
static enum a
implements Comparator<byte[]>
{
private a() {}
}
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/google/common/primitives/UnsignedBytes.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/