Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Read / write file bit by bit" Watch "Read / write file bit by bit" New topic
Author

Read / write file bit by bit

Tomita Militaru
Ranch Hand

Joined: Jan 16, 2009
Posts: 37
Hello,
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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Read / write file bit by bit
 
It's not a secret anymore!