forked from I2P_Developers/i2p.i2p
Router: Put the GarlicMessageParser in the RouterContext
to reduce object churn, we only need one Add DeliveryInstructions.create() to return immmutable local instructions, to reduce object churn Minor cleanups
This commit is contained in:
@@ -63,6 +63,19 @@ public class DeliveryInstructions extends DataStructureImpl {
|
||||
*/
|
||||
public static final DeliveryInstructions LOCAL = new LocalInstructions();
|
||||
|
||||
/**
|
||||
* Returns immutable local instructions, or new
|
||||
*
|
||||
* @since 0.9.20
|
||||
*/
|
||||
public static DeliveryInstructions create(byte[] data, int offset) throws DataFormatException {
|
||||
if (data[offset] == 0)
|
||||
return LOCAL;
|
||||
DeliveryInstructions rv = new DeliveryInstructions();
|
||||
rv.readBytes(data, offset);
|
||||
return rv;
|
||||
}
|
||||
|
||||
public DeliveryInstructions() {
|
||||
_deliveryMode = -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user