diff --git a/core/java/src/net/i2p/util/EepGet.java b/core/java/src/net/i2p/util/EepGet.java index b0f993207..fa456fee7 100644 --- a/core/java/src/net/i2p/util/EepGet.java +++ b/core/java/src/net/i2p/util/EepGet.java @@ -22,6 +22,7 @@ import java.util.StringTokenizer; import net.i2p.I2PAppContext; import net.i2p.data.Base64; +import net.i2p.data.ByteArray; import net.i2p.data.DataHelper; import net.i2p.util.InternalSocket; @@ -1240,6 +1241,8 @@ public class EepGet { protected class Gunzipper implements Runnable { private final InputStream _inRaw; private final OutputStream _out; + private static final int CACHE_SIZE = 8*1024; + private final ByteCache _cache = ByteCache.getInstance(8, CACHE_SIZE); public Gunzipper(InputStream in, OutputStream out) { _inRaw = in; @@ -1247,13 +1250,14 @@ public class EepGet { } public void run() { - ReusableGZIPInputStream in = null; + ReusableGZIPInputStream in = ReusableGZIPInputStream.acquire(); + ByteArray ba = null; long written = 0; try { - in = ReusableGZIPInputStream.acquire(); // blocking in.initialize(_inRaw); - byte buf[] = new byte[8*1024]; + ba = _cache.acquire(); + byte buf[] = ba.getData(); int read = -1; while ( (read = in.read(buf)) != -1) { _out.write(buf, 0, read); @@ -1269,8 +1273,9 @@ public class EepGet { if (_out != null) try { _out.close(); } catch (IOException ioe) {} - if (in != null) - ReusableGZIPInputStream.release(in); + ReusableGZIPInputStream.release(in); + if (ba != null) + _cache.release(ba); } } } diff --git a/history.txt b/history.txt index edeeb8fb3..e77b32774 100644 --- a/history.txt +++ b/history.txt @@ -1,3 +1,12 @@ +2013-06-01 zzz + * EepGet: Used cached byte array in uncompressor + * i2psnark: + - Add idle detector, reduce tunnel count when idle (prep for torrent updates) + - Cancel CoordinatorAcceptor cleaner when halted + - Make PeerCoordinatorSet an Iterable + - Reduce max protocol errors to 1 + - Disable unused PeerMonitorTask + 2013-05-31 zzz * configtunnels.jsp: Allow more hops and tunnels when routerconsole.advanced=true * i2psnark: Fix details page on Windows diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index 0725033fa..f6e6df3a5 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -18,7 +18,7 @@ public class RouterVersion { /** deprecated */ public final static String ID = "Monotone"; public final static String VERSION = CoreVersion.VERSION; - public final static long BUILD = 3; + public final static long BUILD = 4; /** for example "-test" */ public final static String EXTRA = "";