forked from I2P_Developers/i2p.i2p
I2CP: Don't have I2CP Messages extend DataStructureImpl, to save space
Ditto MessageId and SessionId. Fixup unit tests as required
This commit is contained in:
@@ -13,14 +13,14 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import net.i2p.data.DataStructure;
|
||||
|
||||
/**
|
||||
* Defines the base functionality of API messages
|
||||
*
|
||||
* As of 0.9.48, does NOT extend DataStructure.
|
||||
*
|
||||
* @author jrandom
|
||||
*/
|
||||
public interface I2CPMessage extends DataStructure {
|
||||
public interface I2CPMessage {
|
||||
/**
|
||||
* Read the contents from the input stream into the current class's format.
|
||||
* The stream should be the message body as defined by the client access layer
|
||||
|
||||
@@ -16,14 +16,15 @@ import java.io.OutputStream;
|
||||
|
||||
import net.i2p.data.DataFormatException;
|
||||
import net.i2p.data.DataHelper;
|
||||
import net.i2p.data.DataStructureImpl;
|
||||
|
||||
/**
|
||||
* Defines the base message implementation.
|
||||
*
|
||||
* As of 0.9.48, does NOT extend DataStructureImpl.
|
||||
*
|
||||
* @author jrandom
|
||||
*/
|
||||
public abstract class I2CPMessageImpl extends DataStructureImpl implements I2CPMessage {
|
||||
public abstract class I2CPMessageImpl implements I2CPMessage {
|
||||
|
||||
public I2CPMessageImpl() { // nop
|
||||
}
|
||||
|
||||
@@ -15,15 +15,16 @@ import java.io.OutputStream;
|
||||
|
||||
import net.i2p.data.DataFormatException;
|
||||
import net.i2p.data.DataHelper;
|
||||
import net.i2p.data.DataStructureImpl;
|
||||
|
||||
/**
|
||||
* Defines the message ID of a message delivered between a router and a client
|
||||
* in a particular session. These IDs are not globally unique.
|
||||
*
|
||||
* As of 0.9.48, does NOT extend DataStructureImpl.
|
||||
*
|
||||
* @author jrandom
|
||||
*/
|
||||
public class MessageId extends DataStructureImpl {
|
||||
public class MessageId {
|
||||
private long _messageId;
|
||||
|
||||
public MessageId() {
|
||||
|
||||
@@ -14,15 +14,16 @@ import java.io.OutputStream;
|
||||
|
||||
import net.i2p.data.DataFormatException;
|
||||
import net.i2p.data.DataHelper;
|
||||
import net.i2p.data.DataStructureImpl;
|
||||
|
||||
/**
|
||||
* Defines the token passed between the router and client to associate messages
|
||||
* with a particular session. These IDs are not globally unique.
|
||||
*
|
||||
* As of 0.9.48, does NOT extend DataStructureImpl.
|
||||
*
|
||||
* @author jrandom
|
||||
*/
|
||||
public class SessionId extends DataStructureImpl {
|
||||
public class SessionId {
|
||||
private int _sessionId;
|
||||
|
||||
public SessionId() {
|
||||
|
||||
Reference in New Issue
Block a user