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,
posted 8 years ago
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?
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi