private void parseFlags ( byte [ ] flags ) throws ID3v2FormatException { if ( flags . length != FRAME_FLAGS_SIZE ) { throw new ID3v2FormatException ( "Error parsing flags of frame: " + id + ". Expected 2 bytes." ) ; } else { tagAlterDiscard = ( flags [ 0 ] & 0x40 ) != 0 ; fileAlterDiscard = ( flags [ 0 ] & 0x20 ) != 0 ; readOnly = ( flags [ 0 ] & 0x10 ) != 0 ; grouped = ( flags [ 1 ] & 0x40 ) != 0 ; compressed = ( flags [ 1 ] & 0x08 ) != 0 ; encrypted = ( flags [ 1 ] & 0x04 ) != 0 ; unsynchronised = ( flags [ 1 ] & 0x02 ) != 0 ; lengthIndicator = ( flags [ 1 ] & 0x01 ) != 0 ; if ( compressed && ! lengthIndicator ) { throw new ID3v2FormatException ( "Error parsing flags of frame: " + id + ". Compressed bit set without data length bit set." ) ; } } }
Read the information from the flags array .