mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-13 13:05:03 -05:00
25 lines
522 B
Java
25 lines
522 B
Java
|
package com.android.email.mail.transport;
|
||
|
|
||
|
import java.io.IOException;
|
||
|
import java.io.OutputStream;
|
||
|
|
||
|
/**
|
||
|
* A simple OutputStream that does nothing but count how many bytes are written to it and
|
||
|
* makes that count available to callers.
|
||
|
*/
|
||
|
public class CountingOutputStream extends OutputStream {
|
||
|
private long mCount;
|
||
|
|
||
|
public CountingOutputStream() {
|
||
|
}
|
||
|
|
||
|
public long getCount() {
|
||
|
return mCount;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public void write(int oneByte) throws IOException {
|
||
|
mCount++;
|
||
|
}
|
||
|
}
|