Esempio n. 1
0
 public void Marshal(Stream stream)
 {
     Debug.WriteLineIf(Marshaler.marshalSwitch.Enabled, "LongString.Marshal ()");
     stream.WriteByte((byte)BoxTag.DV_STRING);
     Marshaler.MarshalLongInt(stream, bytes.Length);
     stream.Write(bytes, 0, bytes.Length);
 }
Esempio n. 2
0
        public void Marshal(System.IO.Stream stream)
        { /* marshal it as DV_WIDE */
            String str = ToString();

            byte [] bytes = Encoding.UTF8.GetBytes(str);
            if (bytes.Length < 256)
            {
                stream.WriteByte((byte)BoxTag.DV_WIDE);
                stream.WriteByte((byte)bytes.Length);
            }
            else
            {
                stream.WriteByte((byte)BoxTag.DV_LONG_WIDE);
                Marshaler.MarshalLongInt(stream, bytes.Length);
            }
            stream.Write(bytes, 0, bytes.Length);
        }