Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2005

Tip: Looking for answers? Try searching our database.

octet string

Thread view: 
palmis - 20 Dec 2005 11:48 GMT
Hi,
I have a problem. I have an Octet String "00101101". How can I convert
it into byte 00101101?
Thanks.
Gordon Beaton - 20 Dec 2005 12:08 GMT
> I have a problem. I have an Octet String "00101101". How can I
> convert it into byte 00101101?

 String s = "00101101";
 byte b = Byte.parseByte(s,2);

/gordon

Signature

[  do not email me copies of your followups  ]
g o r d o n + n e w s @  b a l d e r 1 3 . s e

kchoudha@gmail.com - 20 Dec 2005 15:55 GMT
> > I have a problem. I have an Octet String "00101101". How can I
> > convert it into byte 00101101?
[quoted text clipped - 7 lines]
> [  do not email me copies of your followups  ]
> g o r d o n + n e w s @  b a l d e r 1 3 . s e
palmis - 21 Dec 2005 08:20 GMT
Dear Gordon and Roedy,
Thank you very much.

Palmis
Roedy Green - 20 Dec 2005 21:21 GMT
>I have a problem. I have an Octet String "00101101". How can I convert
>it into byte 00101101?

see http://mindprod.com/applet/converter.html

String -> int
you have binary, radix 2.  Don't confuse octet with octal, radix 8.

See also http://mindprod.com/jgloss/binary.html
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.