public static uint ReadUInt(this Stream s) => (uint) (s.ReadByte()<<24 | s.ReadByte()<<16 | s.ReadByte()<<8 | s.ReadByte());
public static uint ReadUInt(this byte[] buffer,int offset)=>(uint)(buffer[offset]<<24| buffer[offset+1] << 16 | buffer[offset + 2] << 8 | buffer[offset + 3]);