Solved

Octets

Posted on 1998-06-15
3
404 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

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…
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…
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.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

763 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

6 Experts available now in Live!

Get 1:1 Help Now