Package net.i2p.data.i2np
Class DeliveryInstructions
java.lang.Object
net.i2p.data.DataStructureImpl
net.i2p.data.i2np.DeliveryInstructions
- All Implemented Interfaces:
Serializable,DataStructure
Contains the delivery instructions for garlic cloves.
Generic "delivery instructions" are used both in tunnel messages
and in garlic cloves, with slight differences.
However,
the tunnel message generator TrivialPreprocessor and reader FragmentHandler do not use this class,
the reading and writing is handled inline there.
- Author:
- jrandom
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final DeliveryInstructionsImmutable local instructions, no options -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DeliveryInstructionscreate(byte[] data, int offset) Returns immutable local instructions, or newbooleanbooleanDeprecated.unusedlongDeprecated.unusedintdefault -1default nullbooleanDeprecated.unusedDeprecated.unuseddefault nullintgetSize()default nullinthashCode()intreadBytes(byte[] data, int offset) voidreadBytes(InputStream in) Deprecated.unusedvoidsetDelayRequested(boolean req) Deprecated.unusedvoidsetDelaySeconds(long seconds) Deprecated.unusedvoidsetDeliveryMode(int mode) voidsetDestination(Hash dest) required for DESTINATIONvoidsetEncrypted(boolean encrypted) Deprecated.unusedvoidDeprecated.unusedvoidrequired for ROUTER or TUNNELvoidsetTunnelId(TunnelId id) required for TUNNELtoString()intwriteBytes(byte[] target, int offset) voidwriteBytes(OutputStream out) Deprecated.unusedMethods inherited from class net.i2p.data.DataStructureImpl
calculateHash, fromBase64, fromByteArray, read, toBase64, toByteArray
-
Field Details
-
DELIVERY_MODE_LOCAL
public static final int DELIVERY_MODE_LOCAL- See Also:
-
DELIVERY_MODE_DESTINATION
public static final int DELIVERY_MODE_DESTINATION- See Also:
-
DELIVERY_MODE_ROUTER
public static final int DELIVERY_MODE_ROUTER- See Also:
-
DELIVERY_MODE_TUNNEL
public static final int DELIVERY_MODE_TUNNEL- See Also:
-
LOCAL
Immutable local instructions, no options- Since:
- 0.9.9
-
-
Constructor Details
-
DeliveryInstructions
public DeliveryInstructions()
-
-
Method Details
-
create
Returns immutable local instructions, or new- Throws:
DataFormatException- Since:
- 0.9.20
-
getEncrypted
Deprecated.unusedFor cloves only (not tunnels), default false, unused -
setEncrypted
Deprecated.unusedFor cloves only (not tunnels), default false, unused -
getEncryptionKey
Deprecated.unusedFor cloves only (not tunnels), default null, unused -
setEncryptionKey
Deprecated.unusedFor cloves only (not tunnels), default null, unused -
getDeliveryMode
public int getDeliveryMode()default -1 -
setDeliveryMode
public void setDeliveryMode(int mode) - Parameters:
mode- 0-3
-
getDestination
default null -
setDestination
required for DESTINATION -
getRouter
default null -
setRouter
required for ROUTER or TUNNEL -
getTunnelId
default null -
setTunnelId
required for TUNNEL -
getDelayRequested
Deprecated.unuseddefault false, unused -
setDelayRequested
Deprecated.unuseddefault false, unused -
getDelaySeconds
Deprecated.unuseddefault 0, unused -
setDelaySeconds
Deprecated.unuseddefault 0, unused -
readBytes
Deprecated.unusedDescription copied from interface:DataStructureLoad up the current object with data from the given stream. Data loaded this way must match the I2P data structure specification. Warning - many classes will throw IllegalStateException if data is already set.- Parameters:
in- stream to read from- Throws:
UnsupportedOperationException- always
-
readBytes
- Throws:
DataFormatException
-
writeBytes
Deprecated.unusedDescription copied from interface:DataStructureWrite out the data structure to the stream, using the format defined in the I2P data structure specification.- Parameters:
out- stream to write to- Throws:
UnsupportedOperationException- always
-
writeBytes
public int writeBytes(byte[] target, int offset) - Returns:
- the number of bytes written to the target
-
getSize
public int getSize() -
equals
-
hashCode
public int hashCode() -
toString
-