• Post Reply Bookmark Topic Watch Topic
  • New Topic

InputStream  RSS feed

 
Karl Barnard
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

Can someone here give me an example of how to create a method that takes an InputStream as an parameter, reads the stream and returns the number of characters it contains as an int?

It could be a actual Java code ot a pseudo code.

I just need something to start me off with a method i'm creating.

Thanks.
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out http://faq.javaranch.com/java/ReadDoesntDoWhatYouThinkItDoes
The second piece of code should be able to help you out.
 
Karl Barnard
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Prime wrote:Check out http://faq.javaranch.com/java/ReadDoesntDoWhatYouThinkItDoes
The second piece of code should be able to help you out.

Thanks my friend.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!