added readOnly check
Removed need for outStream to be created in Constructor.