Esempio n. 1
0
 public override UInt16 Write(Byte[] buf, UInt16 offset, int len)
 {
     if (len >= offset + 4)
     {
         NetPacketHeader.HtonUInt32(buf, offset, (UInt32)m_Vlue);
         return(4);
     }
     return(0);
 }
Esempio n. 2
0
        public override UInt16 Write(Byte[] buf, UInt16 offset, int len)
        {
            UInt32[] buffer  = (UInt32[])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.HtonUInt32(buf, offset, buffer[n]);
                    offset += 4;
                }
                return((UInt16)(offset - nResult));
            }
            return(0);
        }