Add case for bg or little indian encoding