CountOutputStream.java
813 Bytes
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
30
31
32
33
34
35
36
37
/*
* Decompiled with CFR 0_118.
*/
package com.adobe.xmp.core.serializer.impl;
import java.io.IOException;
import java.io.OutputStream;
final class CountOutputStream
extends OutputStream {
private final OutputStream out;
private int bytesWritten = 0;
CountOutputStream(OutputStream out) {
this.out = out;
}
public void write(byte[] buf, int off, int len) throws IOException {
this.out.write(buf, off, len);
this.bytesWritten += len;
}
public void write(byte[] buf) throws IOException {
this.out.write(buf);
this.bytesWritten += buf.length;
}
public void write(int b) throws IOException {
this.out.write(b);
++this.bytesWritten;
}
public int getBytesWritten() {
return this.bytesWritten;
}
}