Data Transmission and Object Serialization

Java has provided for a network I/O interface by allowing a Java socket to return a stream object, either a java.net.InputStream or a java.net.OutputStream. This means that reading and writing data to the socket is functionally similar to reading and writing data to any other device that can be used with the stream interface—for example, a file with the FileInputStream or a byte array (with the ByteArrayInputStream). Primitive data types can be transmitted over socket connections without concern for type compatibility across the potentially different machine architectures.

A significant feature of Java socket support is the capability to transmit Java objects over the socket connection. This support ...

Get J2EE™ and Beyond: Design, Develop, and Deploy World-Class Java™ Software now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.