Do not like the extral inBytes flag, but it will solve the problem