I am trying to use ArchiveStream.process on MacOS as outlined in the documentation here:
I have been able to successfully do the following:
- Take objects and create
Data
objects - Create a
UIDocument
that is FileWrapper based - Compress the
UIDocument
as an .aar archive - Upload it to iCloud as a
CKRecord
- Download it as an .aar and decode it back to a directory
- Decode the directory as individual data items and back to objects
The problem is that I sometimes can only download from iCloud once and have the decompression function - other times it may work two or three times but ultimately fails when trying to call ArchiveStream.process
The error reported by ArchiveStream.process
is simply 'ioError'
but on the console I see the following:
[0xa5063c00] Truncated block header (8/16 bytes read)
[0xa503d000] NOP received
[0xa5080400] processStream
[0xa7019000] decoder failed
[0xbd008c00] istream read error
[0xbd031c00] refill buffer
[0x90008000] archive stream read error (header)
[0xc8173800] stream cancelled
The test data I am using does not change so it does not appear to be related to what I am compressing.
But I am at a loss how to prevent the error.
This is IOS 17 running on MacOS (as iPad) and on IOS 17 devices.