fixed size calculation since the damn digestinputstream would call it's own methods twice