encapsulate the input/output streams