Tag Info

Hot answers tagged

7

When serializing data, it's best not to rely on special characters for data separation. Instead, simply let the receiver know how much they need to read to complete the data. Like: PacketID [ByteLengthOfNextVariable NextVariableBytes] Then the receiver knows how much of the packet to read before moving on to the next variable. Ideally, you'd have some ...


2

There are any number of ways to do this. You could, for example, treat || as being a literal | and not your field separator. If your current process for decoding your packet involves first splitting it on single | tokens, you'll probably want to either change the split so it uses a regular expression with a negative lookahead to avoid the || or process the ...


2

If your system can deserialize the data on the other end regardless of the field order, you don't need to enforce that order. But you probably want to anyway, because it's better. If you have any dependency on that ordering (as in, you enumerate the results of getFields() on the receiving end and deserialize each field in succession), you had best make sure ...



Only top voted, non community-wiki answers of a minimum length are eligible