I am making a ToDoList-Console app that needs serialisation of multiple objects. There are 2 task classes:
- Simple task
- Complex task
I need a method that serialises and desirealize these tasks, something like WriteAndReadComplexTask, for both the classes that does not rewrite the whole tasks.json file, but adds it up. This is what I am aiming for as an end result:
[
{
"SimpleTask": "do the dishes"
}
{
"ComplexTask": "buy groceries"
{ "subtask": "bananas",
"subtask": "apples"}
}
{
"simple task": "do some coding"
}
]
SerializeWithLengthPrefixto append arbitrary number of messages to a stream.