Package org.aion.avm.userlib
Class CodeAndArguments
- java.lang.Object
-
- org.aion.avm.userlib.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.
-
-
Constructor Summary
Constructors Constructor Description CodeAndArguments(byte[] code, byte[] arguments)
Creates a new CodeAndArguments for the given code and arguments.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CodeAndArguments
decodeFromBytes(byte[] bytes)
Decodes the CodeAndArguments structure from the given byte[].byte[]
encodeToBytes()
Encodes the receiver as a byte[].
-
-
-
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.
-
-