Red Squirrel
[H]F Junkie
- Joined
- Nov 29, 2009
- Messages
- 9,223
This is sorta in reference to this thread but since it's a separate request figured I'd start a new thread.
I am about to code myself a C# class that will basically be a string class, but will be UTF8, so each char will be one byte, and I will be able to assign values to each byte of a string, add bytes on top etc... pretty much like the C++ string class. I will probably add some more functionality such as a function like WriteInt32 which will write an int into 4 bytes of space in it's binary value.
Before I get into this, does such a class already exist?
If not, and I go ahead with mine, what would be the most efficient way of storing bytes of data in a dynamic fashion? I'm thinking of using a <List> of bytes, but wondering if there's a better way. a byte[] array is no good as I need to predefine how big it is. I suppose I could do that, then just grow it as needed by redeclaring it in buffers, but that will probably be bad in performance.
I am about to code myself a C# class that will basically be a string class, but will be UTF8, so each char will be one byte, and I will be able to assign values to each byte of a string, add bytes on top etc... pretty much like the C++ string class. I will probably add some more functionality such as a function like WriteInt32 which will write an int into 4 bytes of space in it's binary value.
Before I get into this, does such a class already exist?
If not, and I go ahead with mine, what would be the most efficient way of storing bytes of data in a dynamic fashion? I'm thinking of using a <List> of bytes, but wondering if there's a better way. a byte[] array is no good as I need to predefine how big it is. I suppose I could do that, then just grow it as needed by redeclaring it in buffers, but that will probably be bad in performance.