Avoid using the deprecated range interface of OutputStream.