Class AbstractLazyEncodedNamedInteger<T extends NamedInteger>

    • Constructor Detail

      • AbstractLazyEncodedNamedInteger

        protected AbstractLazyEncodedNamedInteger()
        Constructs a new AbstractLazyEncodedNamedInteger with no field values.
      • AbstractLazyEncodedNamedInteger

        protected AbstractLazyEncodedNamedInteger​(byte[] data)
        Constructs a new AbstractLazyEncodedNamedInteger object from network-encoded data. The state is in the encoded form: it is not decoded and might not be decodable.
        Parameters:
        data - network-encoded data
        Throws:
        NullPointerException - if data is null
      • AbstractLazyEncodedNamedInteger

        protected AbstractLazyEncodedNamedInteger​(byte[] data,
                                                  int start,
                                                  int len)
        Constructs a new AbstractLazyEncodedNamedInteger from part of given network-encoded data. The part starts at index start and is len bytes long. The state is in the encoded form: it is not decoded and might not be decodable.
        Parameters:
        data - network-encoded data
        start - starting offset of network-encoded data
        len - length of encoded data in bytes
        Throws:
        NullPointerException - if data is null
        IllegalArgumentException - if len is negative
        ArrayIndexOutOfBoundsException - if the part is not within the data
    • Method Detail

      • fromValue

        protected abstract T fromValue​(int value)
        Converts an int to a NamedInteger. Reuses any existing instance where possible.
        Parameters:
        value - int
        Returns:
        T extends NamedInteger