Use unsynchronized buffered OutputStream for history (#2127)

* Use unsychronized buffered OutputStream

* Add note

* Avoid synchronization on DataOutputStream#write
This commit is contained in:
Hannes Greule
2023-03-06 13:54:35 +01:00
committed by GitHub
parent 211e8034ff
commit 8a3052683e
2 changed files with 13 additions and 3 deletions

View File

@ -20,6 +20,13 @@ public class FaweOutputStream extends DataOutputStream {
return parent;
}
// overwritten to un-synchronized
@Override
public void write(final int b) throws IOException {
out.write(b);
written++;
}
public void write(int b, int amount) throws IOException {
for (int i = 0; i < amount; i++) {
write(b);