'Make sure that if we are reading part of a chunk, we read all of it.
Args:
length: How much data to read.
offset: Where in the file to read it from.
chunksize: How big the chunks in the file are.
Returns:
A (length, offset) tuple, containing the length and offset
required to read all affected chunks.'

@staticmethod
def AlignToChunks(length, offset, chunksize):

    start_chunk = (offset / chunksize)
    end_chunk = ((offset + length) / chunksize)
    if (((offset + length) % chunksize) != 0):
        end_chunk += 1
    new_offset = (start_chunk * chunksize)
    new_length = ((end_chunk * chunksize) - new_offset)
    return (new_length, new_offset)
