I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 7715e648 authored by zzz's avatar zzz
Browse files

Router: Add gzip caches to clearCaches()

parent c807194e
No related branches found
No related tags found
No related merge requests found
...@@ -43,6 +43,15 @@ public class ReusableGZIPInputStream extends ResettableGZIPInputStream { ...@@ -43,6 +43,15 @@ public class ReusableGZIPInputStream extends ResettableGZIPInputStream {
private ReusableGZIPInputStream() { super(); } private ReusableGZIPInputStream() { super(); }
/**
* Clear the cache.
* @since 0.9.21
*/
public static void clearCache() {
if (_available != null)
_available.clear();
}
/******* /*******
public static void main(String args[]) { public static void main(String args[]) {
for (int i = 0; i < 2; i++) for (int i = 0; i < 2; i++)
......
...@@ -75,6 +75,15 @@ public class ReusableGZIPOutputStream extends ResettableGZIPOutputStream { ...@@ -75,6 +75,15 @@ public class ReusableGZIPOutputStream extends ResettableGZIPOutputStream {
/** pull the contents of the stream written */ /** pull the contents of the stream written */
public byte[] getData() { return _buffer.toByteArray(); } public byte[] getData() { return _buffer.toByteArray(); }
/**
* Clear the cache.
* @since 0.9.21
*/
public static void clearCache() {
if (_available != null)
_available.clear();
}
/****** /******
public static void main(String args[]) { public static void main(String args[]) {
try { try {
......
...@@ -52,6 +52,8 @@ import net.i2p.util.I2PThread; ...@@ -52,6 +52,8 @@ import net.i2p.util.I2PThread;
import net.i2p.util.Log; import net.i2p.util.Log;
import net.i2p.util.NativeBigInteger; import net.i2p.util.NativeBigInteger;
import net.i2p.util.OrderedProperties; import net.i2p.util.OrderedProperties;
import net.i2p.util.ReusableGZIPInputStream;
import net.i2p.util.ReusableGZIPOutputStream;
import net.i2p.util.SecureFileOutputStream; import net.i2p.util.SecureFileOutputStream;
import net.i2p.util.SimpleByteCache; import net.i2p.util.SimpleByteCache;
import net.i2p.util.SystemVersion; import net.i2p.util.SystemVersion;
...@@ -420,6 +422,8 @@ public class Router implements RouterClock.ClockShiftListener { ...@@ -420,6 +422,8 @@ public class Router implements RouterClock.ClockShiftListener {
SigningPublicKey.clearCache(); SigningPublicKey.clearCache();
SigUtil.clearCaches(); SigUtil.clearCaches();
I2PSessionImpl.clearCache(); I2PSessionImpl.clearCache();
ReusableGZIPInputStream.clearCache();
ReusableGZIPOutputStream.clearCache();
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment