# Importing a 12 bit array

I have a binary file of 12 bits integers obtained from a camera software. It can produce FITS files from these but the processing time on the large data set I have is excessive. What I have is the disk cache file that contains the same information.

How do I import a binary file/stream by reading 12 bits at at time? I know the size of the array (2560*2160) and the excess length at the end of the file that isn't actual data. I can configure the same camera for 16 bits image and here is how I proceed in this case.

ArrayReshape[
Flatten[Drop[

• Maybe Import[path, "Bit"]? – Rohit Namjoshi Mar 4 at 2:27