Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Octets

Posted on 1998-06-15
3
Medium Priority
?
441 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
agolan earned 600 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

722 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