Class NetworkEnvelope


  • public class NetworkEnvelope
    extends Object

    NetworkEnvelope class.

    • Constructor Detail

      • NetworkEnvelope

        public NetworkEnvelope​(byte[] command,
                               byte[] payload,
                               Boolean testnet)

        Constructor for NetworkEnvelope.

        Parameters:
        command - an array of byte objects
        payload - an array of byte objects
        testnet - a Boolean object
    • Method Detail

      • serialize

        public byte[] serialize()
        Returns the byte serialization of the entire network message
        Returns:
        an array of byte objects
      • isCommand

        public boolean isCommand​(String command)

        isCommand.

        Parameters:
        command - a String object
        Returns:
        a boolean
      • getCommand

        public byte[] getCommand()

        Getter for the field command.

        Returns:
        an array of byte objects
      • getPayload

        public byte[] getPayload()

        Getter for the field payload.

        Returns:
        an array of byte objects
      • getTestnet

        public Boolean getTestnet()

        Getter for the field testnet.

        Returns:
        a Boolean object
      • getMagic

        public byte[] getMagic()

        Getter for the field magic.

        Returns:
        an array of byte objects