/** * Decodes the ASN.1 octet string from the passed buffer. If an error occurs during the decoding * sequence then an AsnDecodingException is thrown by the method. The value is decoded using the * AsnEncoder passed to the object. * * @param buf The encode buffer * @param offset The offset byte to begin decoding * @param encoder The decoder object. * @return The index of the byte immediantly after the last decoded byte of information. * @exception AsnDecodingException Thrown by the encoder if an error occurs trying to decode the * data buffer. */ @Override public int decodeASN(byte[] buf, int offset, AsnEncoder encoder) throws AsnDecodingException { Object[] rVals = encoder.parseString(buf, offset); if (((Byte) rVals[1]).byteValue() != typeId()) throw new AsnDecodingException("Invalid ASN.1 type"); m_data = (byte[]) rVals[2]; return ((Integer) rVals[0]).intValue(); }