forked from I2P_Developers/i2p.i2p
minor cleanup
This commit is contained in:
@@ -96,7 +96,7 @@ public class MessagePayloadMessage extends I2CPMessageImpl {
|
||||
int size = 2 + 4 + 4 + _payload.getSize();
|
||||
try {
|
||||
DataHelper.writeLong(out, 4, size);
|
||||
DataHelper.writeLong(out, 1, getType());
|
||||
DataHelper.writeLong(out, 1, MESSAGE_TYPE);
|
||||
DataHelper.writeLong(out, 2, _sessionId);
|
||||
DataHelper.writeLong(out, 4, _messageId);
|
||||
DataHelper.writeLong(out, 4, _payload.getSize());
|
||||
|
||||
@@ -308,7 +308,7 @@ public class MessageStatusMessage extends I2CPMessageImpl {
|
||||
|
||||
try {
|
||||
DataHelper.writeLong(out, 4, len);
|
||||
DataHelper.writeLong(out, 1, getType());
|
||||
DataHelper.writeLong(out, 1, MESSAGE_TYPE);
|
||||
DataHelper.writeLong(out, 2, _sessionId);
|
||||
DataHelper.writeLong(out, 4, _messageId);
|
||||
DataHelper.writeLong(out, 1, _status);
|
||||
|
||||
@@ -76,7 +76,7 @@ public class ReceiveMessageBeginMessage extends I2CPMessageImpl {
|
||||
|
||||
try {
|
||||
DataHelper.writeLong(out, 4, len);
|
||||
DataHelper.writeLong(out, 1, getType());
|
||||
DataHelper.writeLong(out, 1, MESSAGE_TYPE);
|
||||
DataHelper.writeLong(out, 2, _sessionId);
|
||||
DataHelper.writeLong(out, 4, _messageId);
|
||||
} catch (DataFormatException dfe) {
|
||||
|
||||
@@ -74,7 +74,7 @@ public class SendMessageMessage extends I2CPMessageImpl {
|
||||
|
||||
@Override
|
||||
protected void doReadMessage(InputStream in, int size) throws I2CPMessageException, IOException {
|
||||
if (true) throw new IllegalStateException("wtf, do not run me");
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,8 +84,8 @@ public class SendMessageMessage extends I2CPMessageImpl {
|
||||
*/
|
||||
@Override
|
||||
public void readMessage(InputStream in, int length, int type) throws I2CPMessageException, IOException {
|
||||
if (type != getType())
|
||||
throw new I2CPMessageException("Invalid message type (found: " + type + " supported: " + getType()
|
||||
if (type != MESSAGE_TYPE)
|
||||
throw new I2CPMessageException("Invalid message type (found: " + type + " supported: " + MESSAGE_TYPE
|
||||
+ " class: " + getClass().getName() + ")");
|
||||
if (length < 0) throw new IOException("Negative payload size");
|
||||
|
||||
@@ -129,7 +129,7 @@ public class SendMessageMessage extends I2CPMessageImpl {
|
||||
|
||||
try {
|
||||
DataHelper.writeLong(out, 4, len);
|
||||
DataHelper.writeLong(out, 1, getType());
|
||||
DataHelper.writeLong(out, 1, MESSAGE_TYPE);
|
||||
_sessionId.writeBytes(out);
|
||||
_destination.writeBytes(out);
|
||||
_payload.writeBytes(out);
|
||||
|
||||
Reference in New Issue
Block a user