Quote:
Originally Posted by Shadowz75
Well, those kind of packet classes are less work, but non generic classes are much faster.
|
No, this is not correct, but you are right about my old class.
Few things about it:
1) Only one buffer - for writing. Let it be static for efficiency OR make sure you rarely change its length. For reading - pointer to the address where packet is stored (only at one place).
2) Return pointer, not byte array. For that reason, instead of freeing the buffer, just set the address pointer to the first element so that it writes over.
3) This class suits best File I/O --> No need to be silkroad related.
One thing is true for sure - unmanaged code beats all limits of efficiency if you code it well. I did rewrite that Celebrity class of mine in Delphi though, if anyone's interested I can post it here.