Clean up some static initializers
[mono.git] / mcs / class / corlib / System.Text / Encoding.cs
index 8570be976042cd43fbfcd7f6b5c9415666c4cd1b..7033b15d075ec8bb9d5a2e06dcfaa95ee74eb103 100644 (file)
@@ -42,8 +42,6 @@ public abstract class Encoding : ICloneable
        internal int codePage;
        internal int windows_code_page;
        bool is_readonly = true;
-       
-       internal static readonly byte[] empty = new byte[0];
 
        // Constructor.
        protected Encoding ()
@@ -246,10 +244,10 @@ public abstract class Encoding : ICloneable
                        throw new ArgumentNullException ("s");
 
                if (s.Length == 0)
-                       return empty;
+                       return EmptyArray<byte>.Value;
                int byteCount = GetByteCount (s);
                if (byteCount == 0)
-                       return empty;
+                       return EmptyArray<byte>.Value;
                unsafe {
                        fixed (char* cptr = s) {
                                byte [] bytes = new byte [byteCount];
@@ -697,7 +695,7 @@ public abstract class Encoding : ICloneable
        // Get the identifying preamble for this encoding.
        public virtual byte[] GetPreamble ()
        {
-               return empty;
+               return EmptyArray<byte>.Value;
        }
 
        // Decode a buffer of bytes into a string.