コード例 #1
0
 public override UInt16 Read(Byte[] buf, UInt16 offset, int len)
 {
     if (len >= offset + 4)
     {
         m_Vlue = NetPacketHeader.NtohFloat(buf, offset);
         return(4);
     }
     return(0);
 }
コード例 #2
0
        public override UInt16 Read(Byte[] buf, UInt16 offset, int len)
        {
            float[] buffer;
            UInt16  nResult = offset;
            UInt16  n       = ReadArrayHead(buf, offset);

            offset += n;
            if (len >= offset + (m_nLen * 4))
            {
                buffer = new float[m_nLen];
                for (n = 0; n < m_nLen; ++n)
                {
                    buffer[n] = NetPacketHeader.NtohFloat(buf, offset);
                    offset   += 4;
                }
                m_Vlue = buffer;
                return((UInt16)(offset - nResult));
            }
            return(0);
        }