net.i2p.util
Class BigPipedInputStream
java.lang.Object
java.io.InputStream
java.io.PipedInputStream
net.i2p.util.BigPipedInputStream
- All Implemented Interfaces:
- Closeable
public class BigPipedInputStream
- extends PipedInputStream
Java 1.5 PipedInputStream buffers are only 1024 bytes; our I2CP messages are typically 1730 bytes,
thus causing thread blockage before the whole message is transferred.
We can specify buffer size in 1.6 but not in 1.5.
Until we switch to Java 1.6 -
http://javatechniques.com/blog/low-memory-deep-copy-technique-for-java-objects/
Moved from InternalServerSocket.
- Since:
- 0.8.9
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
getInstance
public static PipedInputStream getInstance()
- default size 64K
getInstance
public static PipedInputStream getInstance(int size)