/// <summary> /// 弹出一个short /// </summary> /// <returns></returns> public short PopShort() { var buf = new byte[2]; Pop(buf); return(ByteUtil.ToShort(buf, 0, NetOrder())); }
/// <summary> /// 获取pos位置的short值 /// </summary> /// <param name="pos"></param> /// <returns></returns> public short GetShort(int pos) { var buf = new byte[2]; Get(pos, buf); return(ByteUtil.ToShort(buf, 0, NetOrder())); }
public static short ReadShort(this Stream stream) { var data = new byte[2]; return(ByteUtil.ToShort(Read(stream, data))); }
/// <summary> /// 在index位置获取一个short类型的数据 /// </summary> /// <param name="index"></param> /// <returns></returns> public short GetShort(int index) { var data = GetData(index, 2); return(ByteUtil.ToShort(data)); }
/// <summary> /// 获取一个short类型的数据 /// </summary> /// <returns></returns> public short GetShort() { var data = GetData(2); return(ByteUtil.ToShort(data)); }