Lab
5
Get started now
1)
Note that a buffer is essentially a fixed length queue. `BufferedInputStream.read()` is analagous to `Queue.poll()`. The `BufferedInputStream` does not have a `Queue.offer()` method. Instead, the `BufferedInputStream` does a bulk load from the `InputStream` whenever the buffer/queue is empty and `read()` is called. Similarly, `BufferOutputStream.write()` is analagous to `Queue.offer()`. Instead of having a `Queue.poll()` method, the `BufferedOutputStream` does a bulk flush to the `OutputStream` when the buffer/queue is filled.