class DecodingUtils {

  public static int getCrc16(byte[] bytes, int offset, int length) {
    int contentSize = length - offset;
    byte[] content = new byte[contentSize];
    System.arraycopy(bytes, offset, content, 0, contentSize);

    int value = 0;
    for (byte element : content) {
      value = unsignedShort((value << 8) ^ CRC16_TABLE[((value >>> 8) ^ element) & 0xff]);
    }
    return value;
  }

}