Class CodeAndArguments


  • public class CodeAndArguments
    extends java.lang.Object
    Just a wrapper over the way we serialize/deserialize the code+arguments tuple for a CREATE call. Specifically, this is encoded as: 4(code length), n(code), [4(args length), n(args)] Note that null args are encoded as code only.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      byte[] arguments  
      byte[] code  
    • Constructor Summary

      Constructors 
      Constructor Description
      CodeAndArguments​(byte[] code, byte[] arguments)
      Creates a new CodeAndArguments for the given code and arguments.
    • Field Detail

      • code

        public final byte[] code
      • arguments

        public final byte[] arguments
    • Constructor Detail

      • CodeAndArguments

        public CodeAndArguments​(byte[] code,
                                byte[] arguments)
        Creates a new CodeAndArguments for the given code and arguments.
        Parameters:
        code - The code (must NOT be null)
        arguments - The arguments (CAN be null)
    • Method Detail

      • decodeFromBytes

        public static CodeAndArguments decodeFromBytes​(byte[] bytes)
        Decodes the CodeAndArguments structure from the given byte[].
        Parameters:
        bytes - The bytes to parse.
        Returns:
        The CodeAndArguments structure or null if bytes couldn't be parsed as such a structure.
      • encodeToBytes

        public byte[] encodeToBytes()
        Encodes the receiver as a byte[].
        Returns:
        The byte[] which can later be deserialized with decodeFromBytes(), above.