public class ScriptChunk
extends java.lang.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) |
Modifier and Type | Method and Description |
---|---|
int |
decodeOpN()
If this chunk is an OP_N opcode returns the equivalent integer value.
|
boolean |
equals(java.lang.Object o) |
boolean |
equalsOpCode(int opcode) |
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.
|
int |
size() |
byte[] |
toByteArray() |
java.lang.String |
toString() |
void |
write(java.io.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 boolean equalsOpCode(int opcode)
public boolean isOpCode()
public boolean isPushData()
public int decodeOpN()
public boolean isShortestPossiblePushData()
public void write(java.io.OutputStream stream) throws java.io.IOException
java.io.IOException
public byte[] toByteArray()
public int size()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object