isBinary function

bool isBinary(
  1. Uint8List bytes
)

Returns true if bytes is binary else false

Implementation

bool isBinary(Uint8List bytes) {
  for (int i = 0; i < bytes.length; i++) {
    if (bytes[i] == 0) {
      return true;
    }
    if (i >= (8000 - 1)) {
      break;
    }
  }
  return false;
}