Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Counting of byte / character / int

807603Nov 12 2007 — edited Nov 17 2007
Hi,

I want to be able to count valid / invalid bytes in a file and in a String.
I have a method
public void countBytes(InputStream stream, File outfile){
      InputStreamReader reader = new InputStreamReader(stream);
      BufferedReader buffReader = new BufferedReader(reader);
      OutputStream out = new FileOutputStream(outfile);
      OutputStreamWriter writer = new OutputStreamWriter(out);
      long validBytes = 0;

      while


}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 15 2007
Added on Nov 12 2007
6 comments
532 views