code: @SuppressWarnings("deprecation")
      private static short shortBE(ByteBuf buffer, int offset) {
          return buffer.order() == ByteOrder.BIG_ENDIAN ?
                  buffer.getShort(offset) : buffer.getShortLE(offset);
      }
docs: Reads a big-endian short integer from the buffer