Object encodeFrame(Object val)

output String or List

Source

Object encodeFrame(Object val) {
  if (_encoder == null) {
    _encoder = (value) {
      if (value is ByteData) {
        return "\u001Bbytes:${Base64.encode(
            ByteDataUtil.toUint8List(value))}";
      }
      return null;
    };
  }

  JsonEncoder c;

  if (_unsafeEncoder == null) {
    _unsafeEncoder = new JsonEncoder(_encoder);
  }
  c = _unsafeEncoder;

  var result = c.convert(val);
  return result;
}