julia> primitive type Int24 24 end
julia> Int24(x::Int) = Core.Intrinsics.trunc_int(Int24, x)
julia> Int(x::Int24) = Core.Intrinsics.zext_int(Int, x)
julia> x = b"\x10\x45\x12\x20\x30\x40"
julia> y = reinterpret(Int24,x)
The 4th byte is ignored here. Julia seems to take every 4 bytes and truncate to Int24, so it uses the first 4 bytes for the first 3-byte number, but that is not what I want.
The above seems to show that julia forces reinterpret() to align on standard integer boundaries even when the primitive type is an odd byte length. Is this a design constraint on reinterpret() or is there a way to specify Int24 that does not cause the loss of the 4th byte of the UInt8 array with reinterpret() of 6 bytes into two integers?