static public char swapChar ( byte [ ] b , int offset ) { // 2 bytes int low = b [ offset ] & 0xff ; int high = b [ offset + 1 ] & 0xff ; return ( char ) ( high << 8 | low ) ; }
Returns the char resulting from swapping 2 bytes at a specified offset in a byte array .