added code to handle the fact that gzread and gzwrite can only read buffers of size MAX_INT