44.1. Overview and Related Methods and Interfaces

A StreamMessage object is used to send a stream of primitive types in the Java programming language. It is filled and read sequentially. It inherits from the Message interface and adds a stream message body. Its methods are based largely on those found in java.io.DataInputStream and java.io.DataOutputStream.

The primitive types can be read or written explicitly using methods for each type. They may also be read or written generically as objects. For instance, a call to StreamMessage.writeInt(6) is equivalent to StreamMessage.writeObject(new Integer(6)). Both forms are provided, because the explicit form is convenient for static programming, and the object form is needed when types are not known ...

Get Java™ Message Service API Tutorial and Reference: Messaging for the J2EE™ Platform 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.