2

When I used my app, on close, it tried to serialize a dictionary that's 300 KB. Because of no disk space, it could only write 292 KB. Is there a way to successfully deserialize whatever is in there?

I used BinaryFormatter and if I lose some elements that's way better than losing the whole dictionary.

When I deserialize I get this exception:

    e.Message   "The input stream is not a valid binary format. The starting contents (in bytes) are: 20-01-20-20-20-FF-FF-FF-FF-01-20-20-20-20-20-20-20 ..."
4

1 に答える 1

2

バイナリ ストリームを分離するには、実装に関する多くの知識が必要です。BinaryFormatterは専有であるため、そのデータが本当に価値のあるものでない限り、失われたと考える方が安上がりかもしれません。たくさんの scrobble を行うこともできますが、それは簡単なことではなく、開発時間も安くはありません。

出来ないとは言いませんが。FWIW、他のシリアライザーでこれを行う方法を考えることができます-そうではありませんBinaryFormatter.

于 2009-10-27T13:14:28.437 に答える