Question writebyte vs writeString

dotnetdummy123

New member
Joined
Aug 31, 2010
Messages
4
Programming Experience
Beginner
Hello All,

I'm new to vb.net, can you please explain the difference.
If I converrt a string to base64, it required writebyte to write the base64 byte array, or should I convert string to base64 then to base64 String then output using writeString?

Is writebyte slower than writeString in term of performance?

Please advise.

Thanks in advance.
 
I have no idea what you're talking about specifically, it does not make sense in .Net terms - but generally one call ("writestring") is faster than many calls ("writebyte", presumably a base64 encoded string consist of many bytes).
 
I have no idea what you're talking about specifically, it does not make sense in .Net terms - but generally one call ("writestring") is faster than many calls ("writebyte", presumably a base64 encoded string consist of many bytes).

Thanks for your replied, just curious, is writeByte accept array of bytes and output as ascii string?


Thanks again.
 
WriteByte has nothing to do with strings. It does what it says: writes a Byte, i.e. an 8-bit number. All data is binary when you get right down to it. If you call WriteString then, under the hood, it will convert that String to a Byte array and then write that, possibly with a call to WriteBytes.
 
WriteByte has nothing to do with strings. It does what it says: writes a Byte, i.e. an 8-bit number. All data is binary when you get right down to it. If you call WriteString then, under the hood, it will convert that String to a Byte array and then write that, possibly with a call to WriteBytes.


Thank you very much for you replied jmcilhinney.


Just curious, Assume if writeString is faster than writeByte, if I want to convert a string to base64 which is in byte array and will use writeByte to output, if this is the case, should I first convert the string to base64 than convert again to string which is base64 string than use writeString. is this a better way of avoiding writeByte due to slower performance against using writeString.

Sorry for my bad english, hope you guys understand.

Thanks in advance.
 
Back
Top