public void readExternal()

in core/src/main/java/flex/messaging/messages/AbstractMessage.java [285:339]


    public void readExternal(ObjectInput input) throws IOException, ClassNotFoundException {
        short[] flagsArray = readFlags(input);

        for (int i = 0; i < flagsArray.length; i++) {
            short flags = flagsArray[i];
            short reservedPosition = 0;

            if (i == 0) {
                if ((flags & BODY_FLAG) != 0)
                    readExternalBody(input);

                if ((flags & CLIENT_ID_FLAG) != 0)
                    clientId = input.readObject();

                if ((flags & DESTINATION_FLAG) != 0)
                    destination = (String) input.readObject();

                if ((flags & HEADERS_FLAG) != 0)
                    headers = (Map) input.readObject();

                if ((flags & MESSAGE_ID_FLAG) != 0)
                    messageId = (String) input.readObject();

                if ((flags & TIMESTAMP_FLAG) != 0)
                    timestamp = ((Number) input.readObject()).longValue();

                if ((flags & TIME_TO_LIVE_FLAG) != 0)
                    timeToLive = ((Number) input.readObject()).longValue();

                reservedPosition = 7;
            } else if (i == 1) {
                if ((flags & CLIENT_ID_BYTES_FLAG) != 0) {
                    clientIdBytes = (byte[]) input.readObject();
                    clientId = UUIDUtils.fromByteArray(clientIdBytes);
                }

                if ((flags & MESSAGE_ID_BYTES_FLAG) != 0) {
                    messageIdBytes = (byte[]) input.readObject();
                    messageId = UUIDUtils.fromByteArray(messageIdBytes);
                }

                reservedPosition = 2;
            }

            // For forwards compatibility, read in any other flagged objects to
            // preserve the integrity of the input stream...
            if ((flags >> reservedPosition) != 0) {
                for (short j = reservedPosition; j < 6; j++) {
                    if (((flags >> j) & 1) != 0) {
                        input.readObject();
                    }
                }
            }
        }
    }