Results 1 to 6 of 6
- 09-11-2009, 09:52 PM #1
Senior Member
- Join Date
- Aug 2009
- Posts
- 294
- Rep Power
- 0
How do I open a file in its pure content?
A computer is just 1/0s. Everyone knows that..
But is there a method in java for opening any file (txt,exe,dll) so that It appears in a string full off 1 and 0 s?
So Of a txt file containing Hello World, if I use that (the function im asking for) then It will return String "101011010101011101011010001101101010011011010 "
Or something simular..
Is there a way to do this?
- 09-11-2009, 10:05 PM #2
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
For what purposes?
See the methods in FileInputStream
- 09-11-2009, 10:09 PM #3
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 7
Read it using an InputStream (not a Reader) byte for byte using Integer.toBinaryString on each byte.
- 09-11-2009, 11:11 PM #4
Senior Member
- Join Date
- Aug 2009
- Posts
- 294
- Rep Power
- 0
Kay thnx =)
Now I have (think so) successfully converted a txt file into pure bites which all lies in one single string..
How do I get it back?
Cause now I must reconvert that file so that the evil monkey in my closet doesn't beat me down again!
Help me please!!
I really ahve no clue what to do! And the monkey is outrageus!
- 09-12-2009, 01:17 AM #5
Senior Member
- Join Date
- Sep 2008
- Posts
- 564
- Rep Power
- 5
you should really seek the answers on search engines. you're more looking for answers that lie in the api's than for solutions to actual problems.
- 09-13-2009, 09:46 PM #6
Senior Member
- Join Date
- Aug 2009
- Posts
- 294
- Rep Power
- 0
Similar Threads
-
how to display content of .xls file in jsp
By kirtichopra in forum Advanced JavaReplies: 7Last Post: 09-15-2009, 04:07 PM -
how to read content of .xls file
By kirtichopra2003 in forum Advanced JavaReplies: 10Last Post: 09-11-2009, 01:03 PM -
Different Files Open in File -> Open Workspace
By mgm2010 in forum JCreatorReplies: 0Last Post: 04-11-2009, 02:14 PM -
How to Encrypt content of txt file?
By aRTx in forum New To JavaReplies: 0Last Post: 03-25-2009, 10:26 AM -
To open an image file such as Jpeg file using JAva Program
By itmani2020 in forum Advanced JavaReplies: 10Last Post: 07-11-2008, 09:57 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks