![JAR search and dependency download from the Maven repository](/logo.png)
net.sourceforge.plantuml.directdot.CounterOutputStream Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of plantuml-mit Show documentation
Show all versions of plantuml-mit Show documentation
PlantUML is a component that allows to quickly write diagrams from text.
// THIS FILE HAS BEEN GENERATED BY A PREPROCESSOR.
package net.sourceforge.plantuml.directdot;
import java.io.IOException;
import java.io.OutputStream;
public class CounterOutputStream extends OutputStream {
// ::remove folder when __HAXE__
private int length;
private final OutputStream os;
public CounterOutputStream(OutputStream os) {
this.os = os;
}
/**
* Writes to nowhere
*/
@Override
public void write(int b) throws IOException {
os.write(b);
length++;
}
/**
* Overridden for performance reason
*/
@Override
public void write(byte b[]) throws IOException {
os.write(b);
length += b.length;
}
/**
* Overridden for performance reason
*/
@Override
public void write(byte b[], int off, int len) throws IOException {
os.write(b, off, len);
length += len;
}
public int getLength() {
return length;
}
@Override
public void flush() throws IOException {
os.flush();
}
@Override
public void close() throws IOException {
os.close();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy