It is currently Mon Dec 10, 2018 6:07 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 16 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Sun Sep 16, 2018 2:00 am 
Offline

Joined: Tue Feb 07, 2017 2:03 am
Posts: 629
nesrocks wrote:
Is what I said totally a bad idea? Or doesn't it apply? The advantage is that the list of objects can be any size. The disadvantage is that it can't have one specific byte value (or bit) at a certain point in the data array. You do need to check for that #FF byte on every item, but when using a counter you need to check against it, so I guess it's the same on that aspect, optimization-wise.
And in the OP case, I imagine it's one big object of 500 bytes? In that case you could reserve #FF to be the end of the data.


You can also say expect FF FF or FF FF FF or FF FF FF FF each getting more unlikely than the next, or you scan all of you data and find a magic combo that is not used at all. But FF seems to be used by a lot of things as an end marker ;)

Or you make an escape byte

FE FE = FE
FE FF = FF
FF XX = End


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page Previous  1, 2

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group