LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 12-17-2005, 07:54 AM   #1
mulciber
Member
 
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, 12:36 PM   #2
elyk1212
Member
 
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.
 
  


Reply


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 05:32 PM
read & write binary file error in redhat xcmore Programming 11 06-17-2005 07:48 AM
Java SDK won't install, binary file not executable, yoper linux 2.6 kernel lopoetve Linux - Software 8 10-30-2004 03:03 AM
can't read from file in java alaios Programming 2 04-24-2004 05:34 AM
java test if string in string array is null. exodist Programming 3 02-21-2004 01:39 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:24 AM.

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