private byte[] RestoreFilter(HttpResponse response) { response.Flush(); response.Filter.Flush(); // Restores the original stream DelegateMemoryStream filter = (DelegateMemoryStream)response.Filter; response.Filter = filter.OriginalStream; return(filter.GetBuffer()); }
private void WriteBuffered(HttpResponse response) { // response.Flush(); // Restores the original stream DelegateMemoryStream filter = (DelegateMemoryStream)response.Filter; response.Filter = filter.OriginalStream; // Writes the buffered contents byte[] buffer = filter.GetBuffer(); response.OutputStream.Write(buffer, 0, buffer.Length); }