// Copyright 1997 The Open Group Research Institute.  All rights reserved.
/**
 * APOptions 
 */

package krb5.lib;

import krb5.lib.asn1.*;

public class APOptions extends BitString {

    /**
     * Class constructor
     */
	public APOptions() {
		super(Krb5.AP_OPTS_MAX + 1);
	}

    /**
     * Class constructor
     * @param oneBit is of type int
  	 * @exception BitStringException an exception  
     * @see krb5.lib.BitStringException
     */
	public APOptions(int oneBit) throws BitStringException {
		super(Krb5.AP_OPTS_MAX + 1);
		set(oneBit);
	}

    /**
     * Class constructor specifying the data and the size
     *
     * @param data is of type byte[]
	 * @param size is of type int
	 * @exception BitStringException an exception 
     * @see krb5.lib.BitStringException
     */
	public APOptions(byte[] data, int size) throws BitStringException {
		super(data, size);
		if (size != Krb5.AP_OPTS_MAX + 1)
			throw new BitStringException(Krb5.BITSTRING_BAD_LENGTH);
	}

    /**
     * Class constructor specifying an encoded reference
     *
     * @param ref is of type EncodeRef
	 * @exception Asn1Exception an exception
	 * @exception BitStringException an exception 
     * @see krb5.lib.BitStringException
     */
	public APOptions(EncodeRef ref) throws Asn1Exception,
		BitStringException {
		super(ref);
		if (size() != Krb5.AP_OPTS_MAX + 1)
			throw new BitStringException(Krb5.BITSTRING_BAD_LENGTH);
	}

}
