You Are Here:

Community: Developer Discussion Boards

#1 Old How can i encode the size of the file? - 1970-01-01, 02:00

Join Date: Mar 2003
Posts: 48
tinduc
Offline
Registered User
i know, that: encoded as bytes where each of them contain 7 bits of the size and most significant bit set to 1.
But, could you give me the example if the picture has the following size: 19725 bytes.
19725--->4d0d--->100110100001101----> can you following??...
thanks
Reply With Quote

#2 Old RE: How can i encode the size of the file? - 1970-01-01, 02:00

Join Date: Mar 2003
Posts: 510
pautamo's Avatar
pautamo
Offline
Super Contributor
19725 -> 4d 0d -> 0100 1101 0000 1101 -> 01 001 1010 000 1101 ->
the most significant bit in last octet is set to 0 for ending mark
1000 0001 1001 1010 0000 1101
BR
M, Forum Nokia
Reply With Quote

#3 Old RE: How can i encode the size of the file? - 1970-01-01, 02:00

Join Date: Mar 2003
Posts: 510
pautamo's Avatar
pautamo
Offline
Super Contributor
Convert size to hex numbers, then to bits, then
take the bits and put them inplace of the xs.
Max 14 bits long number fits to two octets:
1xxx xxxx 0xxx xxxx
Max 21 bits long number fits to three octets:
1xxx xxxx 1xxx xxxx 0xxx xxxx
Convert octets back to hex numbers.
BR
M, Forum Nokia
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia