Changeset f34b467 for core


Ignore:
Timestamp:
Dec 7, 2017 7:53:06 PM (3 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
28f31ae
Parents:
1f569b7
Message:

Util: Deprecate BigPipedInputStream?

Location:
core/java/src/net/i2p/util
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/util/BigPipedInputStream.java

    r1f569b7 rf34b467  
    44
    55/**
     6 *  We are now Java 6 minimum. Just use PipedInputStream.
     7 *
    68 *  Java 1.5 PipedInputStream buffers are only 1024 bytes; our I2CP messages are typically 1730 bytes,
    79 *  thus causing thread blockage before the whole message is transferred.
     
    1315 *  Moved from InternalServerSocket.
    1416 *  @since 0.8.9
     17 *  @deprecated scheduled for removal in 0.9.34
    1518 */
     19@Deprecated
    1620public class BigPipedInputStream extends PipedInputStream {
    1721
    18     private static final boolean oneDotSix = SystemVersion.isJava6();
    19 
    2022    private static final int PIPE_SIZE = 64*1024;
    21 
    22     private BigPipedInputStream(int size) {
    23          super();
    24          buffer = new byte[size];
    25     }
    2623
    2724    /** default size 64K */
     
    3128
    3229    public static PipedInputStream getInstance(int size) {
    33         if (oneDotSix) {
    34             try {
    35                 return new PipedInputStream(size);
    36             } catch (Throwable t) {
    37                 // NoSuchMethodException or NoSuchMethodError if we somehow got the
    38                 // version detection wrong or the JVM doesn't support it
    39             }
    40         }
    41         return new BigPipedInputStream(size);
     30        return new PipedInputStream(size);
    4231    }
    4332}
  • core/java/src/net/i2p/util/EepGet.java

    r1f569b7 rf34b467  
    794794            if (_log.shouldInfo())
    795795                _log.info("Gzipped response, starting decompressor");
    796             PipedInputStream pi = BigPipedInputStream.getInstance();
     796            PipedInputStream pi = new PipedInputStream(64*1024);
    797797            PipedOutputStream po = new PipedOutputStream(pi);
    798798            pusher = new I2PAppThread(new Gunzipper(pi, _out), "EepGet Decompressor");
  • core/java/src/net/i2p/util/InternalServerSocket.java

    r1f569b7 rf34b467  
    9494        if (iss == null)
    9595             throw new IOException("No server for port: " + port);
    96         PipedInputStream cis = BigPipedInputStream.getInstance();
    97         PipedInputStream sis = BigPipedInputStream.getInstance();
     96        PipedInputStream cis = new PipedInputStream(64*1024);
     97        PipedInputStream sis = new PipedInputStream(64*1024);
    9898        PipedOutputStream cos = new PipedOutputStream(sis);
    9999        PipedOutputStream sos = new PipedOutputStream(cis);
  • core/java/src/net/i2p/util/SSLEepGet.java

    r1f569b7 rf34b467  
    577577        _decompressException = null;
    578578        if (_isGzippedResponse) {
    579             PipedInputStream pi = BigPipedInputStream.getInstance();
     579            PipedInputStream pi = new PipedInputStream(64*1024);
    580580            PipedOutputStream po = new PipedOutputStream(pi);
    581581            pusher = new I2PAppThread(new Gunzipper(pi, _out), "EepGet Decompressor");
Note: See TracChangeset for help on using the changeset viewer.