Example #1
0
 public override UInt16 Write(Byte[] buf, UInt16 offset, int len)
 {
     if (len >= offset + 4)
     {
         NetPacketHeader.HtonFloat(buf, offset, (float)m_Vlue);
         return(4);
     }
     return(0);
 }
Example #2
0
        public override UInt16 Write(Byte[] buf, UInt16 offset, int len)
        {
            float[] buffer  = (float[])m_Vlue;
            UInt16  nResult = offset;
            UInt16  n       = WriteArrayHead(buf, offset);

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