Use RandomAccessFile instead of ByteConverter.
Build the message and then write it.
B4X:
Dim raf As RandomAccessFile
Dim buffer(7) As Byte
raf.Initialize(buffer, True)
raf.WriteByte(100, raf.CurrentPosition)
raf.WriteULong32(Millis, raf.CurrentPosition)
raf.WriteInt16(23232, raf.CurrentPosition)
astream.Write(buffer)