Go Job Hunting at the LQ Job Marketplace
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 12-17-2005, 08:54 AM   #1
Registered: Feb 2005
Location: OH
Distribution: Trying to decide
Posts: 55

Rep: Reputation: 15
Java read binary file in as string for RegEx

I have a program in python that reads in a binary file as a string so I can RegEx to find certain values. What is the format to do this in java(The java I/O binary to string part). I'm switching to java so I can better distribute the program and add a gui. Any suggestions? I can post the python script if necessary. Thanks.
Old 12-18-2005, 01:36 PM   #2
Registered: Jan 2005
Location: Chandler, AZ USA
Distribution: Mandrake/Mandriva 10.2
Posts: 186

Rep: Reputation: 30
HI there, please download the Java API documentation from Sun. This will give you the specs on all the methods available to classes, etc. The class you would probably want to use is File or some derivative of this. For java, you would just treat the binary file as a text file, there isn't really much you have to do. You just open the File stream and iterate through as appropriate. I haven't memorized the API, but I could post code if you would like.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
C, howto read binary file into buffer Scrag Programming 24 11-27-2014 06:32 PM
read & write binary file error in redhat xcmore Programming 11 06-17-2005 08:48 AM
Java SDK won't install, binary file not executable, yoper linux 2.6 kernel lopoetve Linux - Software 8 10-30-2004 04:03 AM
can't read from file in java alaios Programming 2 04-24-2004 06:34 AM
java test if string in string array is null. exodist Programming 3 02-21-2004 02:39 PM

All times are GMT -5. The time now is 04:28 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration