Skip to content

Instantly share code, notes, and snippets.

@timsavery
Created March 5, 2013 22:23
Show Gist options
  • Save timsavery/5094895 to your computer and use it in GitHub Desktop.
Save timsavery/5094895 to your computer and use it in GitHub Desktop.
public byte[] RetrieveReportFileChunkable(int reportID, Chatham.Libraries.Enumerations.Report reportType)
{
FileInfo targetFile;
if (reportType == Chatham.Libraries.Enumerations.Report.FMSDataIntegration)
{
// We save data feed files as xml
targetFile = new FileInfo(DocumentManagementHelper.CachedDataFeedFileName(reportID));
}
else
{
targetFile = new FileInfo(DocumentManagementHelper.CachedReportFileName(reportID));
}
using (FileStream stream = targetFile.Open(FileMode.Open, FileAccess.Read, FileShare.Read)) {
var buffer = new byte[stream.Length];
stream.Read(buffer, 0, buffer.Length);
return buffer;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment