469,289 Members | 2,341 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,289 developers. It's quick & easy.

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 21864
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

Post your reply

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

Similar topics

5 posts views Thread by Matthew | last post: by
15 posts views Thread by T Koster | last post: by
1 post views Thread by Vic | last post: by
2 posts views Thread by miltizem | last post: by
4 posts views Thread by dondigitech | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.