MCPcopy Create free account
hub / github.com/SoarGroup/Soar / decode

Method decode

Java/SMLJava/src/main/java/edu/umich/soar/config/Base64.java:68–99  ·  view source on GitHub ↗
(String lines[])

Source from the content-addressed store, hash-verified

66 }
67
68 public static byte[] decode(String lines[])
69 {
70 ByteArrayOutputStream outs = new ByteArrayOutputStream(
71 54 * lines.length);
72
73 for (int lineIdx = 0; lineIdx < lines.length; lineIdx++)
74 {
75 String line = lines[lineIdx];
76
77 for (int idx = 0; idx < line.length(); idx += 4)
78 {
79 int a = decodeLut[(int) line.charAt(idx)];
80 int b = decodeLut[(int) line.charAt(idx + 1)];
81 int c = decodeLut[(int) line.charAt(idx + 2)];
82 int d = decodeLut[(int) line.charAt(idx + 3)];
83
84 int v = (a << 18) | (b << 12) | (c << 6) | d;
85
86 int v0 = (v >> 16) & 0xff;
87 int v1 = (v >> 8) & 0xff;
88 int v2 = v & 0xff;
89
90 outs.write(v0);
91 if (line.charAt(idx + 2) != '=')
92 outs.write(v1);
93 if (line.charAt(idx + 3) != '=')
94 outs.write(v2);
95 }
96 }
97
98 return outs.toByteArray();
99 }
100
101 public static void main(String args[])
102 {

Callers 4

mainMethod · 0.95
getBytesMethod · 0.95
get_text_contentsMethod · 0.80
get_outputFunction · 0.80

Calls 2

lengthMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected