public static char [ ] flagsToChars ( final short flags ) { final char [ ] chars = new char [ ] { ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' } ; final int length = chars . length ; short mask = ( short ) ( 1 << ( length - 1 ) ) ; for ( int i = 0 ; i < length ; i ++ ) { if ( ( flags & mask ) == mask ) { chars [ i ] = ' ' ; } mask >>= 1 ; } return chars ; }
Convert header flags to an array of chars to be human readable .