I did some float math on ints and longs,
and I need to pass the number to a method MetaMessage( int, byte[], int).
The message is: Int CommandNo, byte[] Data, int DataLen
... and the command is structured as command '52', length'4', byte[4]
and that sets the Midi PPQ timer to a number of microseconds writ as 4 byte.
So is going to be 500k-2mil value put into 4byte style
whats the right way to java cast a 2mil int to 4 BYTE[] ?
and I need to pass the number to a method MetaMessage( int, byte[], int).
The message is: Int CommandNo, byte[] Data, int DataLen
... and the command is structured as command '52', length'4', byte[4]
and that sets the Midi PPQ timer to a number of microseconds writ as 4 byte.
So is going to be 500k-2mil value put into 4byte style
whats the right way to java cast a 2mil int to 4 BYTE[] ?
Write to an existing array (MSB order)
Write int to new array in LSB order
ty
ByteBuffer looks like good stuff, I'm gonna bookmark that for future projects