Added `put`, `discard`. Use PStream for output.