Solved

Octets

Posted on 1998-06-15
3
425 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 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

732 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