Changeset 21fe962


Ignore:
Timestamp:
Aug 4, 2018 3:23:36 PM (2 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
775188a3
Parents:
9b3eb8d
Message:

I2NP: Remove unused OutputStream? methods

Location:
router/java/src/net/i2p/data/i2np
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/data/i2np/DeliveryInstructions.java

    r9b3eb8d r21fe962  
    384384    /**
    385385     * @deprecated unused
    386      */
    387     @Deprecated
    388     public void writeBytes(OutputStream out) throws DataFormatException, IOException {
    389         if ( (_deliveryMode < 0) || (_deliveryMode > FLAG_MODE_TUNNEL) ) throw new DataFormatException("Invalid data: mode = " + _deliveryMode);
    390         int flags = getFlags();
    391         //if (_log.shouldLog(Log.DEBUG))
    392         //    _log.debug("Write flags: " + flags + " mode: " + getDeliveryMode()
    393         //               + " =?= " + flagMode(flags));
    394         byte additionalInfo[] = getAdditionalInfo();
    395         out.write((byte) flags);
    396         if (additionalInfo != null) {
    397             out.write(additionalInfo);
    398             out.flush();
    399         }
     386     * @throws UnsupportedOperationException always
     387     */
     388    @Deprecated
     389    public void writeBytes(OutputStream out) {
     390        throw new UnsupportedOperationException();
    400391    }
    401392   
     
    533524
    534525        @Override
    535         public void writeBytes(OutputStream out) throws DataFormatException, IOException {
    536             out.write((byte) 0);
    537         }
    538 
    539         @Override
    540526        public int writeBytes(byte target[], int offset) {
    541527            target[offset] = 0;
  • router/java/src/net/i2p/data/i2np/FastI2NPMessageImpl.java

    r9b3eb8d r21fe962  
    1010
    1111import java.io.IOException;
    12 import java.io.OutputStream;
    1312
    1413import net.i2p.I2PAppContext;
     
    9796   
    9897    /**
    99      *  @deprecated unused
    100      *  @throws UnsupportedOperationException
    101      */
    102     @Deprecated
    103     @Override
    104     public void writeBytes(OutputStream out) throws DataFormatException, IOException {
    105         throw new UnsupportedOperationException();
    106     }
    107    
    108     /**
    10998     *  This tests the reuse-checksum feature.
    11099     *  The results are that mostly UnknownI2NPMessages (from inside a TGM),
  • router/java/src/net/i2p/data/i2np/GarlicClove.java

    r9b3eb8d r21fe962  
    102102     */
    103103    @Deprecated
    104     public void writeBytes(OutputStream out) throws DataFormatException, IOException {
     104    public void writeBytes(OutputStream out) {
    105105        throw new UnsupportedOperationException();
    106 /****
    107         StringBuilder error = null;
    108         if (_instructions == null) {
    109             if (error == null) error = new StringBuilder();
    110             error.append("No instructions ");
    111         }
    112         if (_msg == null) {
    113             if (error == null) error = new StringBuilder();
    114             error.append("No message ");
    115         }
    116         if (_cloveId < 0) {
    117             if (error == null) error = new StringBuilder();
    118             error.append("CloveID < 0 [").append(_cloveId).append("] ");
    119         }
    120         if (_expiration == null) {
    121             if (error == null) error = new StringBuilder();
    122             error.append("Expiration is null ");
    123         }
    124         if (_certificate == null) {
    125             if (error == null) error = new StringBuilder();
    126             error.append("Certificate is null ");
    127         }
    128        
    129         if ( (error != null) && (error.length() > 0) )
    130             throw new DataFormatException(error.toString());
    131 
    132         _instructions.writeBytes(out);
    133 
    134         if (_log.shouldLog(Log.DEBUG))
    135             _log.debug("Wrote instructions: " + _instructions);
    136         try {
    137             byte m[] = _msg.toByteArray();
    138             if (m == null)
    139                 throw new RuntimeException("foo, returned null");
    140             if (m.length <= 0)
    141                 throw new RuntimeException("foo, returned 0 length");
    142             out.write(m);
    143         } catch (RuntimeException e) {
    144             throw new DataFormatException("Unable to write the clove: " + _msg + " to " + out, e);
    145         }
    146         DataHelper.writeLong(out, 4, _cloveId);
    147         DataHelper.writeDate(out, _expiration);
    148         if (_log.shouldLog(Log.DEBUG))
    149             _log.debug("CloveID written: " + _cloveId + " expiration written: "
    150                        + _expiration);
    151         _certificate.writeBytes(out);
    152         if (_log.shouldLog(Log.DEBUG))
    153             _log.debug("Written cert: " + _certificate);
    154 ****/
    155106    }
    156107
  • router/java/src/net/i2p/data/i2np/I2NPMessageImpl.java

    r9b3eb8d r21fe962  
    166166     *
    167167     *  @deprecated unused
     168     *  @throws UnsupportedOperationException always
    168169     */
    169170    @Deprecated
    170     public void writeBytes(OutputStream out) throws DataFormatException, IOException {
    171         int size = getMessageSize();
    172         if (size < 15 + CHECKSUM_LENGTH) throw new DataFormatException("Unable to build the message");
    173         byte buf[] = new byte[size];
    174         int read = toByteArray(buf);
    175         if (read < 0) throw new DataFormatException("Unable to build the message");
    176         out.write(buf, 0, read);
     171    public void writeBytes(OutputStream out) {
     172        throw new UnsupportedOperationException();
    177173    }
    178174
Note: See TracChangeset for help on using the changeset viewer.