I am trying to decode the bytes using GZipDecoder().decodeBytes
from the archive package and I am getting this exception:
ArchiveException('Invalid GZip Signature')
How should I handle this exception? I am getting the List<int>
data using a decoder method Utf16leBytesToCodeUnitsDecoder(zippedBytes).decodeRest()
from the Utf package.
Version
- Platform: Android
- Flutter: 2.10.4
- archive: ^3.3.0
Do let me know if more info is required. Any suggestion or help will be appreciated!
@MarkAdler Then it's not gzip input.
The steps are overall steps as well from picking the file to reading it that I am using. Thanks to MarkAdler for his comment!:
- Convert the file into
Unint8List
by reading the file withvar bytes = File(_path).readAsBytesSync()
- Decoding the Utfle16 bytes to Utf8 bytes by
Utf16leBytesToCodeUnitsDecoder(bytes)
- Finally using
GZipDecoder().decodeBytes
which throws the error.