diff options
Diffstat (limited to 'src/mscorlib/shared/System/Text/UnicodeEncoding.cs')
-rw-r--r-- | src/mscorlib/shared/System/Text/UnicodeEncoding.cs | 41 |
1 files changed, 4 insertions, 37 deletions
diff --git a/src/mscorlib/shared/System/Text/UnicodeEncoding.cs b/src/mscorlib/shared/System/Text/UnicodeEncoding.cs index 0e4db9aaad..846946ce94 100644 --- a/src/mscorlib/shared/System/Text/UnicodeEncoding.cs +++ b/src/mscorlib/shared/System/Text/UnicodeEncoding.cs @@ -14,7 +14,6 @@ using System.Diagnostics.Contracts; namespace System.Text { - [Serializable] public class UnicodeEncoding : Encoding { // Used by Encoding.BigEndianUnicode/Unicode for lazy initialization @@ -1983,7 +1982,6 @@ namespace System.Text (byteOrderMark ? 4 : 0) + (bigEndian ? 8 : 0); } - [Serializable] private sealed class Decoder : System.Text.DecoderNLS, ISerializable { internal int lastByte = -1; @@ -1993,47 +1991,16 @@ namespace System.Text { // base calls reset } - - // Constructor called by serialization, have to handle deserializing from Everett + internal Decoder(SerializationInfo info, StreamingContext context) { - // Any info? - if (info == null) throw new ArgumentNullException(nameof(info)); - Contract.EndContractBlock(); - - // Get Common Info - this.lastByte = (int)info.GetValue("lastByte", typeof(int)); - - try - { - // Try the encoding, which is only serialized in Whidbey - this.m_encoding = (Encoding)info.GetValue("m_encoding", typeof(Encoding)); - this.lastChar = (char)info.GetValue("lastChar", typeof(char)); - this.m_fallback = (DecoderFallback)info.GetValue("m_fallback", typeof(DecoderFallback)); - } - catch (SerializationException) - { - // Everett didn't serialize the UnicodeEncoding, get the default one - bool bigEndian = (bool)info.GetValue("bigEndian", typeof(bool)); - this.m_encoding = new UnicodeEncoding(bigEndian, false); - } + throw new PlatformNotSupportedException(); } - // ISerializable implementation, get data for this object + // ISerializable implementation void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) { - // Any info? - if (info == null) throw new ArgumentNullException(nameof(info)); - Contract.EndContractBlock(); - - // Save Whidbey data - info.AddValue("m_encoding", this.m_encoding); - info.AddValue("m_fallback", this.m_fallback); - info.AddValue("lastChar", this.lastChar); // Unused by everett so it'll probably get lost - info.AddValue("lastByte", this.lastByte); - - // Everett Only - info.AddValue("bigEndian", ((UnicodeEncoding)(this.m_encoding)).bigEndian); + throw new PlatformNotSupportedException(); } public override void Reset() |