made read-or-nil correct, no data on stream != stream is closed
made put method mostly work