sockets - Java: Read/Write compressed objects over TCP -


i have transfer records on tcp though sockets. used objectinputstream , objectoutputstream , worked fine. 1 critical think socket opened once , has remain open through whole communication each side reads , writes more once (so more persistent connection).

i tried compress objects before writing them in order increase overall performance , results quite encouraging but, since used gzipoutputstream , bytearrayoutputstream, memory overhead large , in case outofmemory error.

i tried deflateroutputstream didn't seem apropriate writting objects. there way solve problem?

java serialization convenient, rather ineffective both size-wise , in cpu usage. if want high performance, suggest use different communication protocol, example based on protocol buffers or else light-weight.


Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -