Skip to content

Streaming objects through sockets

ces459 edited this page Feb 10, 2015 · 2 revisions

Process

We have a 4-step system for streaming out data between systems. First the object is serialized in an ObjectOutputStream, and goes through a GZIPOutputStream, which compresses it. Next, it is put through a CipherOutputStream which encrypts the compresses data (better to do this second so that there is less to encrypt). Then, the packages goes through a standard OutputStream which was returned by a function of the Socket connection.

On the other side, the process is reversed to yield the original object.

In summary, our stream chain looks like this:

In.

ObjectOutputStream --> GZIPOutputStream --> CipherOutputStream --> OutputStream --> Socket

Out.

Socket --> InputStream --> CipherInputStream --> GZIPInputStream --> ObjectInputStream

Clone this wiki locally