0

I want to use dart:archive on the server and client side to compress the bandwidth used in my web app.

At the moment I read my uncompressed data as a JSON objects with file sizes up to 360 MB, compressed they are about 1/8 of the size.

My Problem:

If I do a HttpRequest I get the data as a String, but I need the data as a List of Bytes to encode it via archive.

It is may a silly question but it already cost me a bunch of hours.

Thanks and cheers from Germany Felix

Felix
  • 1
  • 1

1 Answers1

2

For HTTP you usually want it as base64 encoded string (How to native convert string -> base64 and base64 -> string)

To get the string as bytes this might help

List<int> bytes = 'abc'.codeunits;

but I'm not sure what you mean by "List of Bytes"

Community
  • 1
  • 1
Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567