'May raise AtomError'

@convert_error(IOError, AtomError)
def __init__(self, fileobj, level=0):

    self.offset = fileobj.tell()
    try:
        (self.length, self.name) = struct.unpack('>I4s', fileobj.read(8))
    except struct.error:
        raise AtomError('truncated    data')
    self._dataoffset = (self.offset + 8)
    if (self.length == 1):
        try:
            (self.length,) = struct.unpack('>Q', fileobj.read(8))
        except struct.error:
            raise AtomError('truncated    data')
        self._dataoffset += 8
        if (self.length < 16):
            raise AtomError('64    bit    atom    length    can    only    be    16    and    higher')
    elif (self.length == 0):
        if (level != 0):
            raise AtomError('only    a    top-level    atom    can    have    zero    length')
        fileobj.seek(0, 2)
        self.length = (fileobj.tell() - self.offset)
        fileobj.seek((self.offset + 8), 0)
    elif (self.length < 8):
        raise AtomError('atom    length    can    only    be    0,    1    or    8    and    higher')
    if (self.name in _CONTAINERS):
        self.children = []
        fileobj.seek(_SKIP_SIZE.get(self.name, 0), 1)
        while (fileobj.tell() < (self.offset + self.length)):
            self.children.append(Atom(fileobj, (level + 1)))
    else:
        fileobj.seek((self.offset + self.length), 0)
