| 1 | // SPDX-License-Identifier: 0BSD |
| 2 | // SPDX-FileCopyrightText: The XZ for Java authors and contributors |
| 3 | // SPDX-FileContributor: Lasse Collin <[email protected]> |
| 4 | // SPDX-FileContributor: Igor Pavlov <https://7-zip.org/> |
| 5 | |
| 6 | package org.tukaani.xz.rangecoder; |
| 7 | |
| 8 | import java.io.OutputStream; |
| 9 | import java.io.IOException; |
| 10 | |
| 11 | public final class RangeEncoderToStream extends RangeEncoder { |
| 12 | private final OutputStream out; |
| 13 | |
| 14 | public RangeEncoderToStream(OutputStream out) { |
| 15 | this.out = out; |
| 16 | reset(); |
| 17 | } |
| 18 | |
| 19 | @Override |
| 20 | void writeByte(int b) throws IOException { |
| 21 | out.write(b); |
| 22 | } |
| 23 | } |