[MUD-Dev] Re: Wild idea.. :)
Chris Gray
cg at ami-cg.GraySage.Edmonton.AB.CA
Sat Sep 5 13:49:43 CEST 1998
[Vadim Tkachenko:]
>Related question (off the top of my head, so that's just a thought
>aloud): is Java serialized stream documented? (guess so) What is a cost
>of cross-platform (mean cross-language and big/little endian (or it's
>always network order?)) serialization engine? (guess VERY HIGH)
Take a look at interfaces "java.io.DataInput" and "java.io.DataOutput".
They are implemented by classes "java.io.DataInputStream" and
"java.io.DataOutputStream" respectively. Also, class
"java.io.RandomAccessFile" implements both interfaces. My guess is
that the transformations are not particularly expensive. Just the usual
order of magnitude slower than equivalent C code. I was just looking
in the the Java Language spec, so didn't see what is available for
the socket classes, but I vaguely recall that there are socket
classes that accept the same kinds of data streams.
In the definitions of those interfaces, the methods used for encoding
and decoding values are all clearly big-endian (network byte order).
This is one of the reasons I decide my binary protocol for AmigaMUD
should stay big-endian, as should my storage format in the MUD
database files. After a bit of fiddling (much of which turned out
not to be related to byte-order issues), I've now got a server
running here on mud.graysage.edmonton.ab.ca that is compatible with
my old AmigaMUD V1.1 client. I haven't gotten the telnet stuff going
for it yet, so unless you are using the custom client, please don't
try to connect. I'll let the list know when I'm ready for that!
--
Chris Gray cg at ami-cg.GraySage.Edmonton.AB.CA
More information about the mud-dev-archive
mailing list