File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Read / write file bit by bit Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Read / write file bit by bit" Watch "Read / write file bit by bit" New topic

Read / write file bit by bit

Tomita Militaru
Ranch Hand

Joined: Jan 16, 2009
Posts: 37
I need to do this assignment in which I need to read / write from / to a file bit by bit using a buffer. When the buffer has 8 bits, I write a byte to the file, same for reading.
Here is why I did so far, I'm using String for reading/writing and I'm sure this is not a good/eficient way to do it. If there is another way can someone please suggest, I don't need the solution directly, just some hints. Thanks

The read method works, but I would like to rewrite the class using another method do it.

Poor is the man whose pleasures depend on the permission of another.
subject: Read / write file bit by bit
Similar Threads
How to read and write for Image and PDF files
problem while dispalying from file
Transferring file name then file data over socket
Convert file to a String
Reading Data from a file and extracting the data