Low fuel output. MULTIFUNCTIONAL OBJECTS

ReferenceStream is no longer supported and has been removed in Pharo 2.0.

Fuel that is well written, well documented, well tested and very fast.

But how can we output several objects at a time?

here is an example for a single object that I found, but this is clearly not enough, but as far as I can do:

FileStream forceNewFileNamed: 'demo.fuel' do: [:aStream | FLSerializer newDefault serialize: objectToSerialize on: aStream binary]. 
+4
source share
2 answers

As stated in the comment, you should use a collection object or a highlighted wrapper object. Fuel doesn't matter what you do. We use Fuel to serialize a model consisting of two separate graphs, and we serialize it more or less as follows:

 FileStream forceNewFileNamed: 'demo.fuel' do: [:aStream | FLSerializer newDefault serialize:{myModel. myAccessControlList} on: aStream binary]. 

Then, after materialization, we put these two objects in different class variables.

+3
source

You can simply do: FLSerializer serialize: {anObject. anotherObject. yetAnotherOne} toFileNamed: 'demo.fuel' FLSerializer serialize: {anObject. anotherObject. yetAnotherOne} toFileNamed: 'demo.fuel'

+3
source

Source: https://habr.com/ru/post/1487957/


All Articles