ObjectOutputStream/ObjectInputStream is totally inefficient when writing just a small amount of data. It creates a
lot of garbage (2 or 3 KB to just a create it) plus it also writes all the header/block header into the stream.
In the server when we serialize the ManagedObjects to sleepycat, we really dont need all the fancy things and we cant
afford to create such overhead. This class is an attempt to solve these problems without getting too complicated.
The readObject() method in this class can only handle reading Literal Objects and will throw an AssertionError for
any other kind of object.
TCObjectOutputStream compliments this class. Since methods DataInputStream are final methods and I want a different
write/readUTF() implementation, I have to reimplement DataInputStream.
|