asByteArray property

List<int>? asByteArray

Implementation

List<int>? get asByteArray {
  if (isByteBuffer) {
    return (_body as ByteBuffer).asUint8List();
  } else if (isBytesArray) {
    return (_body as List<int>).toUint8List();
  } else if (isString) {
    var s = _body as String;
    return s.toUint8List();
  } else if (isMap) {
    return asString!.toUint8List();
  }

  return null;
}