## net.i2p.data
Class Destination

    java.lang.Object
      net.i2p.data.DataStructureImpl
          net.i2p.data.KeysAndCert
              net.i2p.data.Destination

All Implemented Interfaces:
  DataStructure

Direct Known Subclasses:
  VerifiedDestination

    public class Destination

extends KeysAndCert

Defines an end point in the I2P network. The Destination may move around in the network, but messages sent to the Destination will find it

Author:
  jrandom

Field Summary

Fields inherited from class net.i2p.data.KeysAndCert
`__calculatedHash, _certificate, _publicKey, _signingKey`

Constructor Summary
`Destination()`
`Destination(String s)` alternative constructor which takes a base64 string representation

Method Summary
`int` `readBytes(byte[] source, int offset)` deprecated, used only by Packet.java in streaming
`int` `size()`
`int` `writeBytes(byte[] target, int offset)` deprecated, used only by Packet.java in streaming

Methods inherited from class net.i2p.data.KeysAndCert
`calculateHash, equals, getCertificate, getHash, getPublicKey, getSigningPublicKey, hashCode, readBytes, setCertificate, setPublicKey, setSigningPublicKey, toString, writeBytes`

Methods inherited from class net.i2p.data.DataStructureImpl
`fromBase64, fromByteArray, read, toBase64, toByteArray`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Constructor Detail

### Destination

    public Destination()

### Destination

    public Destination(String s)
                throws DataFormatException

  alternative constructor which takes a base64 string representation

  Parameters:
    `s` - a Base64 representation of the destination, as (eg) is used in hosts.txt
  Throws:
    `DataFormatException`

Method Detail

### writeBytes

    public int writeBytes(byte[] target,
                          int offset)

  deprecated, used only by Packet.java in streaming

  Returns:
    the written length (NOT the new offset)

### readBytes

    public int readBytes(byte[] source,
                         int offset)
                  throws DataFormatException

  deprecated, used only by Packet.java in streaming

  Throws:
    `DataFormatException`

### size

    public int size()