validatedBytesFrom

fun validatedBytesFrom(bytes: ByteArray): ByteArrayInputStream

Given an array of bytes, check that the last four bytes, when treated as a Big Endian unsigned int, agree with the CRC32 checksum of the bytes excluding the last four. Fail if they disagree. Answer a ByteArrayInputStream on the bytes excluding the last four.

Return

A ByteArrayInputStream on the non-CRC portion of the bytes.

Parameters

bytes

An array of bytes.

Throws