short GetInt16 (byte [] buffer, int offset) { int uno = (int) buffer [offset]; int dos = (int) buffer [offset + 1]; if (uno == 255 && dos == 255) return -1; return (short) (uno + dos * 256); }