All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sf.jrtps.message.UnknownSubMessage Maven / Gradle / Ivy

package net.sf.jrtps.message;

import net.sf.jrtps.transport.RTPSByteBuffer;

/**
 * UnknownSubMessage. If an unknown SubMessage is received, it is wrapped in
 * this class. Implementation does not known what to do with it, but rest of the
 * SubMessages are processed.
 * 
 * @author mcr70
 * 
 */
public class UnknownSubMessage extends SubMessage {
    private byte[] bytes;

    public UnknownSubMessage(SubMessageHeader smh, RTPSByteBuffer bb) {
        super(smh);

        readMessage(bb);
    }

    private void readMessage(RTPSByteBuffer bb) {
        bytes = new byte[header.submessageLength];
        bb.read(bytes);
    }

    @Override
    public void writeTo(RTPSByteBuffer bb) {
        bb.write(bytes);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy