System.Runtime.Serialization.Formatters.Binary.IOUtil.WriteStringWithCode C# (CSharp) Method

WriteStringWithCode() static private method

static private WriteStringWithCode ( String value, __BinaryWriter sout ) : void
value String
sout __BinaryWriter
return void
        internal static void WriteStringWithCode(String value, __BinaryWriter sout)
        {
            if (value == null)
                sout.WriteByte((Byte)InternalPrimitiveTypeE.Null);
            else
            {
                sout.WriteByte((Byte)InternalPrimitiveTypeE.String);
                sout.WriteString(value);
            }
        }

Usage Example

        // Token: 0x0600529C RID: 21148 RVA: 0x0012229C File Offset: 0x0012049C
        internal static void WriteWithCode(Type type, object value, __BinaryWriter sout)
        {
            if (type == null)
            {
                sout.WriteByte(17);
                return;
            }
            if (type == Converter.typeofString)
            {
                IOUtil.WriteStringWithCode((string)value, sout);
                return;
            }
            InternalPrimitiveTypeE internalPrimitiveTypeE = Converter.ToCode(type);

            sout.WriteByte((byte)internalPrimitiveTypeE);
            sout.WriteValue(internalPrimitiveTypeE, value);
        }
All Usage Examples Of System.Runtime.Serialization.Formatters.Binary.IOUtil::WriteStringWithCode