制作图形界面

This commit is contained in:
Administrator
2022-12-25 14:53:46 +08:00
parent 0797da8eb3
commit 6dd349e722
106 changed files with 13020 additions and 312 deletions
@@ -0,0 +1,43 @@
package org.kne.cloud.network.klalb;
import java.io.IOException;
import java.io.OutputStream;
import java.util.concurrent.atomic.AtomicLong;
public class OutputMetre extends OutputStream {
private OutputStream out;
private AtomicLong total=new AtomicLong(0);
public OutputMetre(OutputStream outputStream) {
this.out=outputStream;
}
@Override
public void write(int b) throws IOException {
out.write(b);
total.incrementAndGet();
}
@Override
public void write(byte[] b) throws IOException {
out.write(b);
total.addAndGet(b.length);
}
@Override
public void write(byte[] b, int off, int len) throws IOException {
out.write(b, off, len);
total.addAndGet(len);
}
@Override
public void flush() throws IOException {
out.flush();
}
@Override
public void close() throws IOException {
out.close();
}
}