[docs] Import of Microsoft BCL Documentation.
[mono.git] / mcs / class / corlib / System.Security.Cryptography / FromBase64Transform.cs
index b182682221da6992984879d18eb63516a75ac559..bf4150c57d1e404e332ab54d4348388f60c5b90b 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Security.Cryptography.FromBase64Transform
+// System.Security.Cryptography.FromBase64Transform.cs
 //
 // Authors:
 //     Sergey Chaban (serge@wildwestsoftware.com)
@@ -33,17 +33,13 @@ using System.Runtime.InteropServices;
 namespace System.Security.Cryptography {
 
        [Serializable]
-#if NET_2_0
        [ComVisible (true)]
-#endif
        public enum FromBase64TransformMode : int {
                IgnoreWhiteSpaces,
                DoNotIgnoreWhiteSpaces
        }
 
-#if NET_2_0
        [ComVisible (true)]
-#endif
        public class FromBase64Transform : ICryptoTransform {
 
                private FromBase64TransformMode mode;
@@ -58,9 +54,9 @@ namespace System.Security.Cryptography {
                {
                }
 
-               public FromBase64Transform (FromBase64TransformMode mode)
+               public FromBase64Transform (FromBase64TransformMode whitespaces)
                {
-                       this.mode = mode;
+                       this.mode = whitespaces;
                        accumulator = new byte [4];
                        accPtr = 0;
                        m_disposed = false;
@@ -92,7 +88,11 @@ namespace System.Security.Cryptography {
                        Dispose (true);
                }
 
+#if NET_4_0
+               public void Dispose ()
+#else
                void IDisposable.Dispose () 
+#endif
                {
                        Dispose (true);
                        GC.SuppressFinalize (this);  // Finalization is now unnecessary
@@ -232,6 +232,9 @@ namespace System.Security.Cryptography {
                                        if (Char.IsWhiteSpace ((char)inputBuffer [i]))
                                                ws++;
                                }
+                               // no more (useful) data
+                               if (ws == inputCount)
+                                       return new byte [0];
                                // there may be whitespace after the terminator
                                int k = inputOffset + inputCount - 1;
                                int n = Math.Min (2, inputCount);