[Pharo-users] Lost in stream
hilaire at drgeo.eu
Fri Jun 15 12:31:52 EDT 2018
I have issue when moving away from the deprecated File API to save PNG
This fromer code to save file (xml or PNG file):
[streamOnDisk := MultiByteFileStream forceNewFileNamed: (self
streamOnDisk nextPutAll: stream contents] ensure:
and the newer one:
(location asFileReference / filename) binaryWriteStreamDo: [
fileStream nextPutAll: stream contents]
The new one produce both wrong XML file and PNG file. The file looks
short cuted at the end.
The XML document contents itself a chunk of binary data (a bitmap
dropped in the drgeo sketch), and the fragility seems to come from there.
I already met fragilities with some file when loading older drgeo
document, but I have not fully tracked the issue.
What is wrong?
The enclosed archive contains both files saved with the former and newer
methods, both XML and PNG documents.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 352669 bytes
Desc: not available
More information about the Pharo-users