Question

QUESTION 3: Text Processing and Persistence (a) Explain in detail why buffered streams are so important while reading from, o

0 0
Add a comment Improve this question Transcribed image text
Answer #1

a). Buffered Streams

Reading data from disk byte by byte is a very inefficient process. One way to speed up is to use a buffer. Instead of reading one byte at a time, read a few thousand bytes at once, and put them in a buffer, in memory. Then we read from buffer with greater speed and efficiency.

When working with files, read and write operations are way more. We could optimize it by having to read and write from the memory instead of the file. So, we use a buffer in memory which temporarily store data to be read from or written to a file. In effect, we are increasing memory access operations instead of file access operations, considering the tradeoff between the two.

b). Regular Expression

\d[A-Z] [a-zA-Z]+ \d{2}:\d{2}
  • \d any digit
  • [A-Z] any uppercase letter
  • [a-zA-Z]+ one or more chararacters, either lower case or upper case
  • \d{2} exactly 2 digits
Add a comment
Know the answer?
Add Answer to:
QUESTION 3: Text Processing and Persistence (a) Explain in detail why buffered streams are so important...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT