Fixed bug for bitsPerSample%8 != 0 case to assume BIG_ENDIAN