package com.jscape.inet.proxy.socks.protocol.v5.marshaling;

import com.jscape.inet.proxy.socks.protocol.v5.messages.Message;
import com.jscape.util.io.DataCodec;

import java.io.IOException;

/**
 * @author Alex Usun
 */
public abstract class BaseCodec
        implements DataCodec<Message> {

    protected static final int VERSION = 0x05;

    protected void assertVersionSupported(int version)
            throws IOException {
        if (version != VERSION) {
            throw new IOException("Unsupported message version: " + version);
        }
    }
}
