question: public static void writeBytes ( OutputStream os , byte [ ] buf ) throws IOException { if ( buf . length < OP_PUSHDATA1 ) { os . write ( buf . length ) ; os . write ( buf ) ; } else if ( buf . length < 256 ) { os . write ( OP_PUSHDATA1 ) ; os . write ( buf . length ) ; os . write ( buf ) ; } else if ( buf . length < 65536 ) { os . write ( OP_PUSHDATA2 ) ; os . write ( 0xFF & ( buf . length ) ) ; os . write ( 0xFF & ( buf . length > > 8 ) ) ; os . write ( buf ) ; } else { throw new RuntimeException ( "Unimplemented" ) ; } }
target:  Writes out the given byte buffer to the output stream with the correct opcode prefix To write an integer call writeBytes(out, Utils.reverseBytes(Utils.encodeMPI(val, false)));