def read(self, istream, kmip_version=enums.KMIPVersion.KMIP_1_0):
super(Enumeration, self).read(istream, kmip_version=kmip_version)<EOL>if self.length != Enumeration.LENGTH:<EOL><INDENT>raise exceptions.InvalidPrimitiveLength(<EOL>"<STR_LIT>".format(Enumeration.LENGTH))<EOL><DEDENT>value = unpack('<STR_LIT>', istream.read(Enumeration.LENGTH))[<NUM_LIT:0>]<EOL>self.value = self.enum(value)<EOL>pad = unpack('<STR_LIT>', istream.read(Enumeration.LENGTH))[<NUM_LIT:0>]<EOL>if pad != <NUM_LIT:0>:<EOL><INDENT>raise exceptions.InvalidPaddingBytes("<STR_LIT>")<EOL><DEDENT>self.validate()<EOL>
Read the encoding of the Enumeration from the input stream.

Args:
    istream (stream): A buffer containing the encoded bytes of an
        Enumeration. Usually a BytearrayStream object. Required.
    kmip_version (KMIPVersion): An enumeration defining the KMIP
        version with which the object will be decoded. Optional,
        defaults to KMIP 1.0.

Raises:
    InvalidPrimitiveLength: if the Enumeration encoding read in has an
        invalid encoded length.
    InvalidPaddingBytes: if the Enumeration encoding read in does not
        use zeroes for its padding bytes.