java.lang.Object
net.i2p.data.DataStructureImpl
net.i2p.data.i2np.DeliveryInstructions
net.i2p.data.i2np.DeliveryInstructions.LocalInstructions
All Implemented Interfaces:
Serializable, DataStructure
Enclosing class:
DeliveryInstructions

private static final class DeliveryInstructions.LocalInstructionsextends DeliveryInstructions
An immutable local delivery instructions with no options for efficiency.
  • Constructor Details

    • LocalInstructions

      private LocalInstructions()
      Local delivery with no options, the mode fixed to LOCAL.
  • Method Details

    • getDeliveryMode

      public int getDeliveryMode()
      Delivery mode for this local delivery.
      Overrides:
      getDeliveryMode in class DeliveryInstructions
      Returns:
      the delivery mode
    • setDeliveryMode

      public void setDeliveryMode(int mode)
      Throws, as local delivery instructions are immutable.
      Overrides:
      setDeliveryMode in class DeliveryInstructions
      Parameters:
      mode - 0-3
    • setDestination

      public void setDestination(Hash dest)
      Throws, as local delivery instructions are immutable.
      Overrides:
      setDestination in class DeliveryInstructions
      Parameters:
      dest - the destination to deliver to
    • setRouter

      public void setRouter(Hash router)
      Throws, as local delivery instructions are immutable.
      Overrides:
      setRouter in class DeliveryInstructions
      Parameters:
      router - the router to deliver to
    • setTunnelId

      public void setTunnelId(TunnelId id)
      Throws, as local delivery instructions are immutable.
      Overrides:
      setTunnelId in class DeliveryInstructions
      Parameters:
      id - the tunnel to deliver to
    • setDelayRequested

      public void setDelayRequested(boolean req)
      Throws, as local delivery instructions are immutable.
      Overrides:
      setDelayRequested in class DeliveryInstructions
      Parameters:
      req - true to request delayed delivery; the request is stored but never acted on
    • setDelaySeconds

      public void setDelaySeconds(long seconds)
      Throws, as local delivery instructions are immutable.
      Overrides:
      setDelaySeconds in class DeliveryInstructions
      Parameters:
      seconds - the delay to request, in seconds; stored but never acted on
    • readBytes

      public int readBytes(byte[] data, int offset)
      Throws, as local delivery instructions are immutable.
      Overrides:
      readBytes in class DeliveryInstructions
      Parameters:
      data - the buffer holding the encoded delivery instructions
      offset - the index within data of the flags byte starting the instructions
      Returns:
      the number of bytes read
    • writeBytes

      public int writeBytes(byte[] target, int offset)
      Writes the zero flag byte, as local delivery has no additional info.
      Overrides:
      writeBytes in class DeliveryInstructions
      Parameters:
      target - the buffer to serialize into
      offset - the index within target of the first byte written
      Returns:
      the number of bytes written to the target
    • getSize

      public int getSize()
      Local delivery serializes to a single flag byte.
      Overrides:
      getSize in class DeliveryInstructions
      Returns:
      always 1
    • toString

      public String toString()
      String form for debugging.
      Overrides:
      toString in class DeliveryInstructions