summaryrefslogtreecommitdiffstats
path: root/SendGrid/SendGridMail/Utils.cs
diff options
context:
space:
mode:
authorBrandon West <brawest@gmail.com>2013-01-14 11:23:58 -0700
committerBrandon West <brawest@gmail.com>2013-01-14 11:23:58 -0700
commit9467474bed75ca54ff944716a468e029c25cd898 (patch)
tree93a2ac3ab787417002106edfa14b5ffc58572346 /SendGrid/SendGridMail/Utils.cs
parent7b6db5794a097c43703a90e2f0863967b78426a9 (diff)
parentbd267f5bde6c27ff13ed9bc0f03add90b5b4aa3d (diff)
downloadsendgrid-csharp-9467474bed75ca54ff944716a468e029c25cd898.zip
sendgrid-csharp-9467474bed75ca54ff944716a468e029c25cd898.tar.gz
sendgrid-csharp-9467474bed75ca54ff944716a468e029c25cd898.tar.bz2
Merge branch 'release/restsharp'
Diffstat (limited to 'SendGrid/SendGridMail/Utils.cs')
-rwxr-xr-xSendGrid/SendGridMail/Utils.cs14
1 files changed, 14 insertions, 0 deletions
diff --git a/SendGrid/SendGridMail/Utils.cs b/SendGrid/SendGridMail/Utils.cs
index 31fe92f..c6f4386 100755
--- a/SendGrid/SendGridMail/Utils.cs
+++ b/SendGrid/SendGridMail/Utils.cs
@@ -28,5 +28,19 @@ namespace SendGridMail
return "{"+String.Join(",",dic.Select(kvp => Serialize(kvp.Key) + ":" + Serialize(kvp.Value)))+"}";
}
+ public static byte[] ReadFully(Stream input)
+ {
+ byte[] buffer = new byte[16*1024];
+ using (MemoryStream ms = new MemoryStream())
+ {
+ int read;
+ while ((read = input.Read(buffer, 0, buffer.Length)) > 0)
+ {
+ ms.Write(buffer, 0, read);
+ }
+ return ms.ToArray();
+ }
+ }
+
}
}