def METHOD_NAME(f, endian):
    """Read a 2-Byte integer from file f
    with a given endianness (byte order).
    endian can be either 'big' or 'little'.
    """
    if (endian != "little") and (endian != "big"):
        _logger.debug("File address:", f.tell())
        raise ByteOrderError(endian)
    else:
        data = f.read(2)
        if endian == "big":
            s = B_ushort
        elif endian == "little":
            s = L_ushort
        return s.unpack(data)[0]