0

websocket连接成功,并且接收到数据,snapshot.data比如[31, 42, 42,12.......] 数据被zstd压缩了,怎么解压?

channel = new IOWebSocketChannel.connect('ws://$SOCKET_URL?token=$userToken');

// socket connected success

StreamBuilder(
        stream: channel.stream,
        builder: (context, snapshot) {
          
          print(snapshot.data);  // recieved data [31, 42, 42,12.......]

          final result = compress(snapshot.data);  // here how to compress

          return new Padding(
            child: new Text(''),
          );
        },
      )

从pub.dev找到一个包,但我不知道如何使用它,请你提供一个例子,非常感谢

4

0 回答 0