@classmethod
def from_fileobj(klass, fileobj, endianness=None, check=True):
    """ Return read structure with given or guessed endiancode

        Parameters
        ----------
        fileobj : file-like object
           Needs to implement ``read`` method
        endianness : None or endian code, optional
           Code specifying endianness of read data

        Returns
        -------
        wstr : WrapStruct object
           WrapStruct object initialized from data in fileobj
        """
    raw_str = fileobj.read(klass.template_dtype.itemsize)
    return klass(raw_str, endianness, check)
