Q:

Bytes to signed short

I get two bytes, for example 0xFE and 0x70, it should represent the value of -400. How could I convert those bytes to signed short? Is it even possible?

A:

In C/C++ you can use union:
union Foo {
    unsigned char bytes[sizeof(short)];
    short value;
};

. . .

bool isBigEndian()
{
    Foo foo;
    foo.value = 0x0102;
    return foo.bytes[0] == 0x01;
}

. . .

Foo foo;

if (isBigEndian()) {
    foo.bytes[0] = 0xFE;
    foo.bytes[1] = 0x70;
}
else {
    foo.bytes[1] = 0xFE;
    foo.bytes[0] = 0x70;
}

bool shouldBeTrue = foo.value == -400;

UPDATE-UPDATE. This solution is correct for big-endian and little-endian computers. Thanks for πάντα ῥεῖ.
In C# you can use BitConverter.GetBytes and BitConverter.ToInt16. To test endianess you can check BitConverter.IsLittleEndian.

A:

Should work in C, C++ and C# (and possible java)
 short val;
 val = (byte1 << 8) | byte2;

