Exemplo n.º 1
0
        public DataObject GetDataObject()
        {
            if (structureType == BerStructureType.Constructed)
            {
                throw new InvalidOperationException("Constructed data is not supported by this method.");
            }

            if (!DataObjectFactory.CanCreate(tag))
            {
                throw new NotSupportedException("Object creation for tag " + tag.ToString() + " is not supported.");
            }

            DataObject obj = DataObjectFactory.CreateInstance(
                tag,
                packet,
                contentStartIndex,
                contentLength);

            return(obj);
        }