code: public static int crc16(ByteBuffer bytes) {
  
          int crc = 0x0000;
  
          while (bytes.hasRemaining()) {
              crc = doCrc(bytes.get(), crc);
          }
  
          return crc & 0xFFFF;
      }
docs: Create a CRC16 checksum from the bytes.
  
  @param bytes input bytes
  @return CRC16 as integer value
  @since 4.4