WriteString () vs writeLongString ()
by Stefan Lundmark · in Torque Game Engine · 01/10/2007 (2:38 pm) · 3 replies
Hello!
I'm a little bit confused. These are the things I knew about these two functions when I made the choice to use writeLongString ():
writeString ()
1 .Is used in the Torque SDK across connections.
2. Is used in TNL across connections.
3. Accepts input of max 256 length.
writeLongString ()
1. Is not used in the Torque SDK across connections, only when writing regular streams.
2. Does not exist in TNL.
3. Accepts input of any length.
Soooooo, a minute ago I noticed that the latter function does not employ Huffman compression, and is not even a function of BitStream. So it looks pretty clear to me, writeLongString () was not meant to be used across connections.
Can anyone confirm or deny? Thanks in advance!
I'm a little bit confused. These are the things I knew about these two functions when I made the choice to use writeLongString ():
writeString ()
1 .Is used in the Torque SDK across connections.
2. Is used in TNL across connections.
3. Accepts input of max 256 length.
writeLongString ()
1. Is not used in the Torque SDK across connections, only when writing regular streams.
2. Does not exist in TNL.
3. Accepts input of any length.
Soooooo, a minute ago I noticed that the latter function does not employ Huffman compression, and is not even a function of BitStream. So it looks pretty clear to me, writeLongString () was not meant to be used across connections.
Can anyone confirm or deny? Thanks in advance!
About the author
#2
Thanks Stephen.
01/11/2007 (1:30 am)
Still, they both work across connections (hence me being confused) - there are just no examples of it in either SDK. :)Thanks Stephen.
#3
01/11/2007 (4:20 am)
I think writeLongString() is meant to be used for writing to file streams. Since connections also happens to be streams it's also available there for some reason, but it's obviously not optimized for that kind of stuff.
Torque 3D Owner Stephen Zepp