MCPcopy Create free account
hub / github.com/cconlon/kerberos-java-gssapi / byteArrayToInt

Method byteArrayToInt

examples/Util.java:219–228  ·  view source on GitHub ↗
(byte[] data)

Source from the content-addressed store, hash-verified

217
218 /* Based on http://snippets.dzone.com/posts/show/93 */
219 public static int byteArrayToInt(byte[] data)
220 {
221 if (data == null || data.length != 4) return 0x0;
222 return (int)(
223 (0xff & data[0]) << 24 |
224 (0xff & data[1]) << 16 |
225 (0xff & data[2]) << 8 |
226 (0xff & data[3]) << 0
227 );
228 }
229
230 public static void printSubString(String first, String second) {
231 System.out.printf(" | %-18s= %s\n", first, second);

Callers 4

WriteTokenMethod · 0.95
ReadTokenMethod · 0.95
WriteTokenMethod · 0.95
ReadTokenMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected