summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--crypto/src/util/Arrays.cs22
1 files changed, 22 insertions, 0 deletions
diff --git a/crypto/src/util/Arrays.cs b/crypto/src/util/Arrays.cs
index 1f9711555..6be94c543 100644
--- a/crypto/src/util/Arrays.cs
+++ b/crypto/src/util/Arrays.cs
@@ -591,6 +591,28 @@ namespace Org.BouncyCastle.Utilities
             return rv;
         }
 
+        public static byte[] Concatenate(byte[] a, byte[] b, byte[] c)
+        {
+                if (a != null && b != null && c != null)
+                {
+                        byte[] rv = new byte[a.Length + b.Length + c.Length];
+
+                        Array.Copy(a, 0, rv, 0, a.Length);
+                        Array.Copy(b, 0, rv, a.Length, b.Length);
+                      	Array.Copy(c, 0, rv, a.Length + b.Length, c.Length);
+
+                        return rv;
+                }
+                else if (b == null)
+                {
+                        return Concatenate(a, c);
+	        }
+                else
+                {
+                        return Concatenate(a, b);
+                }
+        }
+
         public static int[] Concatenate(int[] a, int[] b)
         {
             if (a == null)