public static byte[] extractQualifier(final byte[] qualifier, 
      final int offset) {
    validateQualifier(qualifier, offset);
    if ((qualifier[offset] & Const.MS_BYTE_FLAG) == Const.MS_BYTE_FLAG) {
      return new byte[] { qualifier[offset], qualifier[offset + 1],
          qualifier[offset + 2], qualifier[offset + 3] };
    } else {
      return new byte[] { qualifier[offset], qualifier[offset + 1] };
    }
  }
public static byte [ ] extractQualifier ( final byte [ ] qualifier , final int offset ) { validateQualifier ( qualifier , offset ) ; if ( ( qualifier [ offset ] & Const . MS_BYTE_FLAG ) == Const . MS_BYTE_FLAG ) { return new byte [ ] { qualifier [ offset ] , qualifier [ offset + 1 ] , qualifier [ offset + 2 ] , qualifier [ offset + 3 ] } ; } else { return new byte [ ] { qualifier [ offset ] , qualifier [ offset + 1 ] } ; } }
Extracts the 2 or 4 byte qualifier from a compacted byte array
@param qualifier The qualifier to parse
@param offset An offset within the byte array
@return A byte array with only the requested qualifier
@throws IllegalArgumentException if the qualifier is null or the offset falls
outside of the qualifier array
@since 2.0