public static void WriteUInt16(Stream s, ushort v) { s.WriteByte((byte)(v >> 8)); s.WriteByte((byte)v); }
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); }
public static void WriteChar(Stream s, char v) { s.WriteByte((byte)(v >> 8)); s.WriteByte((byte)v); }
public static void WriteBoolean(Stream s, bool v) { s.WriteByte((byte)(v ? 1 : 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 }
public static void WriteSByte(Stream s, sbyte v) { s.WriteByte((byte)v); }
//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); }