Writing Streaming Libraries with Streams