@Test public void testToByteArray_OP_PUSHDATA1() { byte[] bytes = new byte[0xFF]; RANDOM.nextBytes(bytes); byte[] expected = Arrays.concatenate(new byte[] { OP_PUSHDATA1, (byte) 0xFF }, bytes); byte[] actual = new ScriptChunk(OP_PUSHDATA1, bytes).toByteArray(); assertArrayEquals(expected, actual); }
public byte[] toByteArray() { ByteArrayOutputStream stream = new ByteArrayOutputStream(); try { write(stream); } catch (IOException e) { throw new RuntimeException(e); } return stream.toByteArray(); }
ScriptChunk { public byte[] toByteArray() { ByteArrayOutputStream stream = new ByteArrayOutputStream(); try { write(stream); } catch (IOException e) { throw new RuntimeException(e); } return stream.toByteArray(); } }
ScriptChunk { public byte[] toByteArray() { ByteArrayOutputStream stream = new ByteArrayOutputStream(); try { write(stream); } catch (IOException e) { throw new RuntimeException(e); } return stream.toByteArray(); } ScriptChunk(int opcode, @Nullable byte[] data);  ScriptChunk(int opcode, @Nullable byte[] data, int startLocationInProgram); }
ScriptChunk { public byte[] toByteArray() { ByteArrayOutputStream stream = new ByteArrayOutputStream(); try { write(stream); } catch (IOException e) { throw new RuntimeException(e); } return stream.toByteArray(); } ScriptChunk(int opcode, @Nullable byte[] data);  ScriptChunk(int opcode, @Nullable byte[] data, int startLocationInProgram); boolean equalsOpCode(int opcode); boolean isOpCode(); boolean isPushData(); int getStartLocationInProgram(); int decodeOpN(); boolean isShortestPossiblePushData(); void write(OutputStream stream); byte[] toByteArray(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); }
ScriptChunk { public byte[] toByteArray() { ByteArrayOutputStream stream = new ByteArrayOutputStream(); try { write(stream); } catch (IOException e) { throw new RuntimeException(e); } return stream.toByteArray(); } ScriptChunk(int opcode, @Nullable byte[] data);  ScriptChunk(int opcode, @Nullable byte[] data, int startLocationInProgram); boolean equalsOpCode(int opcode); boolean isOpCode(); boolean isPushData(); int getStartLocationInProgram(); int decodeOpN(); boolean isShortestPossiblePushData(); void write(OutputStream stream); byte[] toByteArray(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); final int opcode; @Nullable
    final byte[] data; }