CRC Mismatch

upsis

Member
Licensed User
Longtime User
Hi,
When decompress a gzip file I receive the message "CRC Mismatch", code below, what could be? The zipped file is OK.

Dim In As InputStream
Dim compress As CompressedStreams
In = File.OpenInput(File.DirRootExternal, "carga0004.gz")
In = compress.WrapInputStream(In, "gzip")
Dim reader As TextReader
reader.Initialize(In)
Dim line As String
line = reader.ReadAll

Thanks for help
 
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
I've tried this code and it works fine:
B4X:
Sub Activity_Create(FirstTime As Boolean)
Dim In As InputStream
Dim compress As CompressedStreams
In = File.OpenInput(File.DirAssets, "carga0004")
In = compress.WrapInputStream(In, "gzip")
Dim reader As TextReader
reader.Initialize(In)
Dim line As String
line = reader.ReadAll
Log(line.Length)
End Sub
Note that I had to remove the file extension before adding it to the Files tab (related to the Android packager).
 
Upvote 0

upsis

Member
Licensed User
Longtime User
unknown format

I run exactly your code with the file that I send to you and I receive the message "unknown format" when execut "In = compress.WrapInputStream(In, "gzip")".
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…