Exemplo n.º 1
0
 public static void WriteUInt16(Stream s, ushort v)
 {
     s.WriteByte((byte)(v >> 8));
     s.WriteByte((byte)v);
 }
Exemplo n.º 2
0
 public static void WriteUInt32(Stream s, uint v)
 {
     s.WriteByte((byte)(v >> 24));
     s.WriteByte((byte)(v >> 16));
     s.WriteByte((byte)(v >> 8));
     s.WriteByte((byte)v);
 }
Exemplo n.º 3
0
 public static void WriteChar(Stream s, char v)
 {
     s.WriteByte((byte)(v >> 8));
     s.WriteByte((byte)v);
 }
Exemplo n.º 4
0
 public static void WriteBoolean(Stream s, bool v)
 {
     s.WriteByte((byte)(v ? 1 : 0));
 }
Exemplo n.º 5
0
        public static void WriteBytes(Stream s, string v)
        {
            int length = v.Length;
            for (int index = 0; index < length; index++)
#if CODE_ANALYSIS
                s.WriteByte(v.CharAt(index) & 0xff);
#else
                s.WriteByte((byte)(v[index] & 0xff));
#endif
        }
Exemplo n.º 6
0
 public static void WriteSByte(Stream s, sbyte v)
 {
     s.WriteByte((byte)v);
 }
Exemplo n.º 7
0
        //public static int SkipBytes(Stream s, int n)
        //{
        //    // note: This is actually a valid implementation of this method, rendering it quite useless...
        //    return 0;
        //}

        #endregion

        #region Write

        public static void WriteByte(Stream s, byte v)
        {
            s.WriteByte(v);
        }