类 ScriptChunk
- java.lang.Object
-
- io.nuls.base.script.ScriptChunk
-
public class ScriptChunk extends Object
A script element that is either a entity push (signature, pubkey, etc) or a non-push (logic, numeric, etc) operation.
-
-
构造器概要
构造器 构造器 说明 ScriptChunk(int opcode, byte[] data)ScriptChunk(int opcode, byte[] data, int startLocationInProgram)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 intdecodeOpN()If this chunk is an OP_N opcode returns the equivalent integer value.booleanequals(Object o)booleanequalsOpCode(int opcode)intgetStartLocationInProgram()inthashCode()booleanisOpCode()If this chunk is a single byte of non-pushdata content (could be OP_RESERVED or some invalid Opcode)booleanisPushData()Returns true if this chunk is pushdata content, including the single-byte pushdatas.booleanisShortestPossiblePushData()Called on a pushdata chunk, returns true if it uses the smallest possible way (according to BIP62) to push the entity.StringtoString()voidwrite(OutputStream stream)
-
-
-
字段详细资料
-
opcode
public final int opcode
Operation to be executed. Opcodes are defined inScriptOpCodes.
-
data
@Nullable public final byte[] data
For push operations, this is the vector to be pushed on the stack. ForScriptOpCodes.OP_0, the vector is empty. Null for non-push operations.
-
-
方法详细资料
-
equalsOpCode
public boolean equalsOpCode(int opcode)
-
isOpCode
public boolean isOpCode()
If this chunk is a single byte of non-pushdata content (could be OP_RESERVED or some invalid Opcode)
-
isPushData
public boolean isPushData()
Returns true if this chunk is pushdata content, including the single-byte pushdatas.
-
getStartLocationInProgram
public int getStartLocationInProgram()
-
decodeOpN
public int decodeOpN()
If this chunk is an OP_N opcode returns the equivalent integer value.
-
isShortestPossiblePushData
public boolean isShortestPossiblePushData()
Called on a pushdata chunk, returns true if it uses the smallest possible way (according to BIP62) to push the entity.
-
write
public void write(OutputStream stream) throws IOException
- 抛出:
IOException
-
-