summaryrefslogtreecommitdiff
path: root/platform/java/src/com/artifex/mupdf/fitz/BufferOutputStream.java
blob: c802f417036def18f37275c92a6bc766a53978b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package com.artifex.mupdf.fitz;

import java.io.IOException;
import java.io.OutputStream;

public class BufferOutputStream extends OutputStream
{
	protected Buffer buffer;
	protected int position;
	protected int resetPosition;

	public BufferOutputStream(Buffer buffer) {
		super();
		this.buffer = buffer;
		this.position = 0;
	}

	public void write(byte[] b) {
		buffer.writeBytes(b);
	}

	public void write(byte[] b, int off, int len) {
		buffer.writeBytesFrom(b, off, len);
	}

	public void write(int b) {
		buffer.writeByte((byte) b);
	}
}