Use snakebite to implement stream_read