Example usage for org.eclipse.jgit.util NB decodeUInt16

List of usage examples for org.eclipse.jgit.util NB decodeUInt16

Introduction

In this page you can find the example usage for org.eclipse.jgit.util NB decodeUInt16.

Prototype

public static int decodeUInt16(final byte[] intbuf, final int offset) 

Source Link

Document

Convert sequence of 2 bytes (network byte order) into unsigned value.

Usage

From source file:com.google.gerrit.gpg.Fingerprint.java

License:Apache License

public static String toString(byte[] fp) {
    checkLength(fp);//from   w  w w  . ja va  2  s . com
    return String.format("%04X %04X %04X %04X %04X  %04X %04X %04X %04X %04X", NB.decodeUInt16(fp, 0),
            NB.decodeUInt16(fp, 2), NB.decodeUInt16(fp, 4), NB.decodeUInt16(fp, 6), NB.decodeUInt16(fp, 8),
            NB.decodeUInt16(fp, 10), NB.decodeUInt16(fp, 12), NB.decodeUInt16(fp, 14), NB.decodeUInt16(fp, 16),
            NB.decodeUInt16(fp, 18));
}