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!

how do I get the length of an input stream?

807589Dec 29 2008 — edited Dec 30 2008
I have an inpustream object coming into a method, and I do
stream.read(key);
where key is a byte array of 512 bytes. I would rather the key array be the number of characters (or length) of the stream of data being read so that I don't have to repeatedly call read until it reaches the end of the file. Thanks! btw, I left another post about whitespace but no one has answerred yet; any help would be appreciated on these 2 questions!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 27 2009
Added on Dec 29 2008
5 comments
1,830 views