Solved

Octets

Posted on 1998-06-15
3
407 Views
Last Modified: 2013-12-26
Ok. I need some code to convert octets (such as those in a response to a LIST command from a POP3 server) to bytes (something you pass to OTAllocMem()). Can anybody help me? I really need this code. The problem is that I'm not sure if octets are a base 8 numbering, if they are the number of 8-char chunks in whatever you're talking about, and whatever they are, how to convert them.
0
Comment
Question by:WileyKat
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
agolan earned 300 total points
ID: 1291433
Octets are the correct name for BYTES.
Once upon a time ... well, they were computers with different byte size, some had 7 bits, some 12 bits, some had 5 bits !
The majority had 8 bits and it's the reason the term octet is no very well known.
Octet, has the same root a Octal, you are right, from the latin,
Oct is 8.
Nowadays, most only the french use "Octet" in common computer language, but thsi is definatly the right name for a bunch of 8 bits.
Now to your programming question, an Octet is equivalent to an unsigned char, values goes from 0 to 255 (total 256).

So for allocation purposes, allocate the number of octets as if they were bytes. (add one or two to be on the safe side).
Also be aware (if you are not) that the Macintosh OS usually
provide pascal strings, that unlike C string are not zero terminated. The first octet (unsigned byte) contains the lenght
of the string.
I hope it helped, otherwise please specify also language.
0
 
LVL 1

Expert Comment

by:agolan
ID: 1291434
And it's not worth 300 points ;-)
tough it would be nice.... it's not worth it.
If you are happy, I'll be happy with half of it.
0
 
LVL 2

Author Comment

by:WileyKat
ID: 1291435
agolan, thanks for your help, but I never graded your answer. it's possible that too much time passed between your answer and now, since I've been away for a month. what grade did you get for it?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Host to IP 7 76
move a line in eclipse 3 80
FizzBuzz challenge 9 76
sumHeights  challenge 17 65
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now