public static void WriteLong(int v, Stream stream) { stream.WriteByte((byte)((v >> 24) & 0xff)); stream.WriteByte((byte)((v >> 16) & 0xff)); stream.WriteByte((byte)((v >> 8) & 0xff)); stream.WriteByte((byte)(v & 0xff)); }