forked from I2P_Developers/i2p.i2p
* I2NP: Allow message to be written more than once,
instead of throwing an IllegalStateException
This commit is contained in:
@@ -27,16 +27,13 @@ public class DataMessage extends I2NPMessageImpl {
|
||||
}
|
||||
|
||||
public byte[] getData() {
|
||||
verifyUnwritten();
|
||||
return _data;
|
||||
}
|
||||
public void setData(byte[] data) {
|
||||
verifyUnwritten();
|
||||
_data = data;
|
||||
}
|
||||
|
||||
public int getSize() {
|
||||
verifyUnwritten();
|
||||
return _data.length;
|
||||
}
|
||||
|
||||
@@ -60,7 +57,6 @@ public class DataMessage extends I2NPMessageImpl {
|
||||
}
|
||||
/** write the message body to the output array, starting at the given index */
|
||||
protected int writeMessageBody(byte out[], int curIndex) {
|
||||
verifyUnwritten();
|
||||
if (_data == null) {
|
||||
out[curIndex++] = 0x0;
|
||||
out[curIndex++] = 0x0;
|
||||
@@ -76,12 +72,6 @@ public class DataMessage extends I2NPMessageImpl {
|
||||
return curIndex;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void written() {
|
||||
super.written();
|
||||
_data = null;
|
||||
}
|
||||
|
||||
public int getType() { return MESSAGE_TYPE; }
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user