Addressing large byte[] issue

java finds it hard to allocate a contiguous large byte[]. Hence a new
structure called the CompositeByteArray is created and serialization and
communication is modified to use that whenever possible