Reading files into memory and writing them from buffer.