-
Notifications
You must be signed in to change notification settings - Fork 4
Streaming objects through sockets
ces459 edited this page Feb 10, 2015
·
2 revisions
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:
ObjectOutputStream --> GZIPOutputStream --> CipherOutputStream --> OutputStream --> Socket
Socket --> InputStream --> CipherInputStream --> GZIPInputStream --> ObjectInputStream