public class ScriptChunk extends Object
Modifier and Type | Field and Description |
---|---|
byte[] |
data
For push operations, this is the vector to be pushed on the stack.
|
int |
opcode
Operation to be executed.
|
Constructor and Description |
---|
ScriptChunk(int opcode,
byte[] data) |
ScriptChunk(int opcode,
byte[] data,
int startLocationInProgram) |
Modifier and Type | Method and Description |
---|---|
int |
decodeOpN()
If this chunk is an OP_N opcode returns the equivalent integer value.
|
boolean |
equals(Object o) |
boolean |
equalsOpCode(int opcode) |
int |
getStartLocationInProgram() |
int |
hashCode() |
boolean |
isOpCode()
If this chunk is a single byte of non-pushdata content (could be OP_RESERVED or some invalid Opcode)
|
boolean |
isPushData()
Returns true if this chunk is pushdata content, including the single-byte pushdatas.
|
boolean |
isShortestPossiblePushData()
Called on a pushdata chunk, returns true if it uses the smallest possible way (according to BIP62) to push the data.
|
String |
toString() |
void |
write(OutputStream stream) |
public final int opcode
ScriptOpCodes
.@Nullable public final byte[] data
ScriptOpCodes.OP_0
, the vector is
empty. Null for non-push operations.public ScriptChunk(int opcode, byte[] data)
public ScriptChunk(int opcode, byte[] data, int startLocationInProgram)
public boolean equalsOpCode(int opcode)
public boolean isOpCode()
public boolean isPushData()
public int getStartLocationInProgram()
public int decodeOpN()
public boolean isShortestPossiblePushData()
public void write(OutputStream stream) throws IOException
IOException
Copyright © 2016. All rights reserved.