Is the cast to `OutputStream` required?