package auvlcm;
 
import java.io.*;
import java.util.*;
 
public final class os_conduit_raw_t implements lcm.lcm.LCMEncodable
{
    public long utime;
    public int age;
    public String value;
 
    public os_conduit_raw_t()
    {
    }
 
    public static final long LCM_FINGERPRINT;
    public static final long LCM_FINGERPRINT_BASE = 0x861adaae169d18deL;
 
    static {
        LCM_FINGERPRINT = _hashRecursive(new ArrayList<Class>());
    }
 
    public static long _hashRecursive(ArrayList<Class> classes)
    {
        if (classes.contains(auvlcm.os_conduit_raw_t.class))
            return 0L;
 
        classes.add(auvlcm.os_conduit_raw_t.class);
        long hash = LCM_FINGERPRINT_BASE
            ;
        classes.remove(classes.size() - 1);
        return (hash<<1) + ((hash>>63)&1);
    }
 
    public void encode(DataOutput outs) throws IOException
    {
        outs.writeLong(LCM_FINGERPRINT);
        _encodeRecursive(outs);
    }
 
    public void _encodeRecursive(DataOutput outs) throws IOException
    {
        byte[] __strbuf = null;
        outs.writeLong(this.utime); 
 
        outs.writeInt(this.age); 
 
        __strbuf = this.value.getBytes("UTF-8"); outs.writeInt(__strbuf.length+1); outs.write(__strbuf, 0, __strbuf.length); outs.writeByte(0); 
 
    }
 
    public os_conduit_raw_t(byte[] data) throws IOException
    {
        this(new DataInputStream(new ByteArrayInputStream(data)));
    }
 
    public os_conduit_raw_t(DataInput ins) throws IOException
    {
        if (ins.readLong() != LCM_FINGERPRINT)
            throw new IOException("LCM Decode error: bad fingerprint");
 
        _decodeRecursive(ins);
    }
 
    public static auvlcm.os_conduit_raw_t _decodeRecursiveFactory(DataInput ins) throws IOException
    {
        auvlcm.os_conduit_raw_t o = new auvlcm.os_conduit_raw_t();
        o._decodeRecursive(ins);
        return o;
    }
 
    public void _decodeRecursive(DataInput ins) throws IOException
    {
        byte[] __strbuf = null;
        this.utime = ins.readLong();
 
        this.age = ins.readInt();
 
        __strbuf = new byte[ins.readInt()-1]; ins.readFully(__strbuf); ins.readByte(); this.value = new String(__strbuf, "UTF-8");
 
    }
 
    public auvlcm.os_conduit_raw_t copy()
    {
        auvlcm.os_conduit_raw_t outobj = new auvlcm.os_conduit_raw_t();
        outobj.utime = this.utime;
 
        outobj.age = this.age;
 
        outobj.value = this.value;
 
        return outobj;
    }
 
}

