* I2NP: Allow message to be written more than once,

instead of throwing an IllegalStateException
This commit is contained in:
zzz
2010-12-02 18:12:38 +00:00
parent 8f8fb0e5cb
commit 5ba101063a
6 changed files with 3 additions and 44 deletions

View File

@@ -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