Sunday 15 June 2014

language agnostic - Is there some byte combination that can be used as a separator of streams of Int16 -


I was given the task to specify the file format for internal use within an application.

The desired requirements say:

The data section of the file must be composed of a series of currents of Int16 value (short integer ), A combination of one or more bytes delimited by a suitable.

As I understand, in Int16 , any can be a single byte value, so I do not know if I have some sequence of bytes How can I choose, which is not guaranteed to appear relevant in any stream, is there any such sequence?

(And also, if the answer is "no", then what would be a good way to determine the status and size of each stream in the file?)

"streams" From, I believe that this request indicates that when the data begins to be written, then the length is unknown.

Therefore, I suggest "chunked" encoding, where each substream is divided into variable-sized pieces, with the length of each piece written in the form of a fixed size integer . An empty arc indicates the end of the system. Generally, there will be a maximum length to facilitate the allocation of buffers for efficient reading and writing.

This is sampled after HTTP and is used in many other formats like, such as the indefinite length

encoding supported by

No comments:

Post a Comment