Re: Types Conversion
"andrewzzz" <bugpezz@gmail.com> wrote in message
news:1156174089.680686.9470@p79g2000cwp.googlegroups.com...
Hi Guys,
I have some problems about converting types..
1-What is the fastest way to convert from Calendar to byte array?
2-What is the fastst way to convert from String to byte array?
3-How do I convert Certificate to byte array?
4-How do I convert PrivateKey to byte array?
There are multiple ways of converting from one format to another, just
like there are multiple ways of converting letters to numbers. For example,
you might map A to 1, B to 2, C to 3, etc. Or you might map A to 0, B to 1,
C to 2, etc. Before worrying about speed, you should probably think about
what values map onto what other values first.
5-How do I merge multiple byte arrays into a bigger one?
There are multiple ways of doing this. The simplest would be to
concatenate the sequences of bytes together, but then you lose the
information of where each sequence starts and end. To get around this, you
might want to additionally encode the length of each sequence, for example,
or have some sort of special "end of sequence" marker.
- Oliver