This week's giveaway is in the Threads forum.
We're giving away four copies of Java Concurrency Live Lessons and have Doug Schmidt on-line!
See this thread for details.
Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

multi-line matcher  RSS feed

 
Natesan Prabhakaran
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hai, can you please explain how to read full content of buffer or a file at a time. i want to use a multline matcher for a file content..thanks,

regards
prabhakaran
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For any stream you can read bytes and append them to a StringBuffer. For a file or any stream where you might know the number of bytes to expect, you can read into a byte array of exactly the right size in a single shot. And somebody once posted a cute Scanner trick to read a stream into a string in one line using EOF as the delimiter.

Is that the right kind of thing?
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!