java.lang.Object
net.i2p.data.i2cp.I2CPMessageImpl
net.i2p.data.i2cp.DestLookupMessage
All Implemented Interfaces:
I2CPMessage

public class DestLookupMessageextends I2CPMessageImpl
Request the router look up the dest for a hash.
  • Field Details

    • MESSAGE_TYPE

      public static final int MESSAGE_TYPE
      I2CP message type code for a destination lookup request.
      See Also:
    • _hash

      private Hash _hash
      The destination being looked up.
  • Constructor Details

    • DestLookupMessage

      public DestLookupMessage()
      Creates an empty message, to be filled in from the stream on read.
    • DestLookupMessage

      public DestLookupMessage(Hash h)
      Creates a message asking the router to resolve a destination hash.
      Parameters:
      h - the destination hash the router is asked to look up
  • Method Details

    • getHash

      public Hash getHash()
      Returns the destination hash the router is asked to resolve.
      Returns:
      the 32-byte destination hash the router is asked to resolve
    • doReadMessage

      protected void doReadMessage(InputStream in, int size) throws I2CPMessageException, IOException
      Read the message body from the input stream.
      Specified by:
      doReadMessage in class I2CPMessageImpl
      Parameters:
      in - positioned just past the 4 byte size and 1 byte type header
      size - how many payload bytes remain to be read
      Throws:
      I2CPMessageException - if the message format is invalid
      IOException - if there's an error reading from the stream
    • doWriteMessage

      protected byte[] doWriteMessage() throws I2CPMessageException, IOException
      Write the message body to the output stream.
      Specified by:
      doWriteMessage in class I2CPMessageImpl
      Returns:
      byte array
      Throws:
      I2CPMessageException - if the message cannot be written
      IOException - if there's an error writing to the stream
    • getType

      public int getType()
      Returns the I2CP message type code for this message.
      Returns:
      DestLookupMessage's I2CP type code, for dispatch
    • toString

      public String toString()
      Returns a string representation of this message.
      Overrides:
      toString in class Object