473,563 Members | 2,295 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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,

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

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

Similar topics

5
19458
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 query a router for mac addresses pysnmp returns octetstrings like this: \000\002\263\254\264\351 \010\000 \301F\021 \010\000 \300\303[...
5
3339
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 printer using a RawPrinterHelper class that i found I believe in the msdn. the class works wonderfully when I send stright text data (in the...
15
2014
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 fread to read three bytes from it. The question is though, where should fread put this? I have considered two alternatives, but neither seem like a...
5
5304
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 quotes), and also some more text like this and file name (e.g. "Content-Disposition: form-data; name="upload_file";...
0
1455
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), and also some more text like this and file name (e.g. "Content-Disposition: form-data; name="upload_file"; filename="C:\testing\myfile.dat"...
4
5526
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 converting the binary blocks to strings first, then converting the resulting string to base64. This seems highly inefficient and I'd like to just go...
1
2593
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 ascii of (00.00.11.00.00.02) .. ........ Likewise I read the mac entries from the text file using a perl script and do some processing
2
6263
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 jumo from the first to the second .. what's the relation ? doesn anyone know ? without progrmming it .. Exemple: In octet string : 31 32 2E 32 30...
4
4376
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 conversion: string revLim = Convert.ToString(curveData, 2); // curveData = 0x14 // I want 00010100 // I am getting 10100
0
7658
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7579
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7877
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8101
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6238
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5204
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3631
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3615
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1194
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.