473,563 Members | 2,295 Online

# Conversion into Binary Octet String

41 New Member
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 22350
JosAH
11,448 Recognized Expert MVP
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
itgaurav198
41 New Member
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,

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 Recognized Expert MVP
Hi,

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
itgaurav198
41 New Member
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 Recognized Expert MVP
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
mathewhai
1 New Member
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.n aming.ldap.attr ibutes.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