473,396 Members | 1,767 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Conversion into Binary Octet String

Hi,

Is it possible to convert a string in "Binary Octet String".?Also, if possible, please make clear what "Binary Octet String" is.

Thanks
Nov 7 '07 #1
6 22335
JosAH
11,448 Expert 8TB
Hi,

Is it possible to convert a string in "Binary Octet String".?Also, if possible, please make clear what "Binary Octet String" is.

Thanks
An 'octet' is a group of eight bits; we used to call that a 'byte' but bytes can
contain more than eight bits. An octet can contain 256 different values and we
usually interpret those values as numbers in the range [0,255] or [-128,127];

There are a few methods available that can convert those octet values to their
binary representation which is a String.

kind regards,

Jos
Nov 7 '07 #2
An 'octet' is a group of eight bits; we used to call that a 'byte' but bytes can
contain more than eight bits. An octet can contain 256 different values and we
usually interpret those values as numbers in the range [0,255] or [-128,127];

There are a few methods available that can convert those octet values to their
binary representation which is a String.

kind regards,

Jos
Hi,

Thanks for your quick reply.

As you have written that there are few methods to convert octet values into binary that are strings. But I have to convert a string into Octet. So do you mean that first i have to convert it into binart then into octet. If I am right how can i implement it in java.

Thanks
Nov 7 '07 #3
JosAH
11,448 Expert 8TB
Hi,

Thanks for your quick reply.

As you have written that there are few methods to convert octet values into binary that are strings. But I have to convert a string into Octet. So do you mean that first i have to convert it into binart then into octet. If I am right how can i implement it in java.

Thanks
You've got it the wrong way around: an octet can contain 256 different values;
it's us humans that want to represent those numbers in writing (Strings). There
are a lot of representations for numbers and a binary representation is one of
them. So representations are always Strings. You can convert numbers (stored
in octets) to their String representation and vice versa.

Read the API documentation for the following classes: Byte, Integer, and String.

kind regards,

Jos
Nov 7 '07 #4
You've got it the wrong way around: an octet can contain 256 different values;
it's us humans that want to represent those numbers in writing (Strings). There
are a lot of representations for numbers and a binary representation is one of
them. So representations are always Strings. You can convert numbers (stored
in octets) to their String representation and vice versa.

Read the API documentation for the following classes: Byte, Integer, and String.

kind regards,

Jos
Hi,
Actually I am working on IBM Tivoli Identity Manager and I have to store the value of password in an attribuet that is of type Binary Octet String and I am entering the value in String. Thats why I have to convert it. Is there any other way to do this.

Thaks
Nov 7 '07 #5
JosAH
11,448 Expert 8TB
Hi,
Actually I am working on IBM Tivoli Identity Manager and I have to store the value of password in an attribuet that is of type Binary Octet String and I am entering the value in String. Thats why I have to convert it. Is there any other way to do this.

Thaks
Ah, I think I'm beginning to understand what you want. Read the API documentation
for the String class and pay special attention to the getBytes() method.

kind regards,

Jos
Nov 7 '07 #6
Not sure on how to set the Octet String value to the server. if you want to manipulate an Octet String value from Directory Server, java providers one option like env.put("java.naming.ldap.attributes.binary", "mpegVideo mySpecialKey");
So the Octet String value will be retrieved as binary, we can store it in a byte array and do thye things. may be some similar reverse mechanism will be there for storing the values.
Feb 19 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Matthew | last post by:
I am working on some software that uses SNMP to get information from routers and switches. I am using the pysnmp module (v2.0.8) to do the snmp part. The problem that I am having is that when I...
5
by: john | last post by:
Here is the short story of what i'm trying to do. I have a 4 sided case labeling printer setting out on one of our production lines. Now then i have a vb.net application that sends data to this...
15
by: T Koster | last post by:
Hi group, I'm having some difficulty figuring out the most portable way to read 24 bits from a file. This is related to a Base-64 encoding. The file is opened in binary mode, and I'm using...
5
by: Neo | last post by:
Hello: I am receiving a Binary File in a Request from a application. The stream which comes to me has the boundary (Something like "---------------------------39<WBR>­0C0F3E0099" without the...
0
by: Neo | last post by:
Hello: I am receiving a Binary File in a Request from a application. The stream which comes to me has the boundary (Something like "---------------------------390C0F3E0099" without the quotes),...
4
by: Russell Warren | last post by:
I've got a case where I want to convert binary blocks of data (various ctypes objects) to base64 strings. The conversion calls in the base64 module expect strings as input, so right now I'm...
1
by: Vic | last post by:
I have a c program which writes mac address entries onto a text file. Text file when opened in vim looks like this index mac 1 ^@^@^Q^@^@^A ascii of (00.00.11.00.00.01) 2 ^@^@^Q^@^@^B...
2
by: miltizem | last post by:
Guys i'm using a software to monitor the signal over noise factor of a traffic ... The result is given under two formats .. First an octet string Second a decibel number my question how can i...
4
by: dondigitech | last post by:
I want to convert hex to binary without losing bits. I want to preserve the 8-bits because I ultimately need a 24-bit string to grab information from. I am just using this line of code for the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.