Converting an Array of Byte to Array{T}

You can use reinterpret to treat your array of bytes as an array of some other bitstype:

julia> reinterpret(Int32, vec(A))
2-element reinterpret(Int32, ::Array{UInt8,1}):
 16777216
    65536

Note that I had to use vec because your A is actually a 1x8 matrix, not a vector. Storing A as a vector (using commas instead of spaces as delimiters) would remove that issue.

Note also that this gives the wrong answer, presumably because you are expecting a different endianness. Using ntoh fixes that:

julia> ntoh.(reinterpret(Int32, vec(A)))
2-element Array{Int32,1}:
   1
 256
2 Likes