Removed buffer use

Sometimes it causes outOfMemoryException and there's no need to write to a separate buffer since you can copy the inputStream directly to the file.