c# - FileHelpers-like data import/export utility for binary data? -


When I work with text data, I use the excellent filehallers library to give it a file or in-memory Allows to dump the text field with the string very easily, which represents the data.

Serial data stream in me to work with a large endian microcontroller-based system. To save space on a very limited microcontroller platform, I need to write raw binary data which includes areas of various multi-byte types (essentially a straight variable dumping outside the serial port).

I like the architecture of the FileHalper. I create a class that represents the data and tags it with the attributes which tells the engine to insert data into the class. I can feed a string representing the engine representing a single record and can get a deserialized representation of the data. However, this object is different from serialization because raw data has not been delimited in any way, it is a simple binary fixed record format.

FileHelpers is probably not suitable for reading such binary data. It can not control the null that looks and * I suspect that there may be unicode problems (The engine takes an input as string, so I have to read the bytes from the serial port and translate them into Unicode string before going into my data converter sections). As an experiment I have set it to read the binary stream and "strike" until I want to send the tap. It still works very well It is easy to install new converters , Who read raw data and read And such accounts for the Andian Foroting issues. It currently fails and can not process many records (it expects CRLF between records).

What should I know, if anyone is aware of an open-source library that works similarly to FileHelper, but it is designed to handle binary data.

I am thinking of doing something about FileHelper to handle this task, but it seems that there must be something already available to do this.

* It has been found that it does not complain about the tap in the input stream. There was an unrelated problem in my testing program, from where I was expecting the problem with the tap. A little deeper should be checked first!

I have not used FileHelper, so I can not make a direct comparison; However, if you have an object-model that represents your object, then you can try it; This is a binary alternate engine for .NET in Google's Compact "Protocol Buffers" wire format. Much more efficient than things like XML, but without the need to write all your serialization codes.

Note that "Protocol buffers" does have some very brief markers (usually a byte) between fields; It adds an small padding, but version tolerance has improved greatly. For "packed" data (i.e., an array is called, block) it can be left when desired.

So: If you want a compact production, it would be nice. If you need a specific output, then maybe less.

Disclosure: I am an author, so I am biased; But it's free.


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -