public void WriteBytes(IoBuffer buf)
 {
     if (null == buf)
         WriteNull();
     else
     {
         buf.Flip();
         var length = buf.Remaining;
         buf.PutInt32(length);
         buf.Put(buf);
     }
 }