use the correct type of OutputStream