
/**
 * stream live capture
 *
 * @author matecsaba
 */
public class streamer {

    /**
     * the main
     *
     * @param args arguments
     * @throws Exception on error
     */
    public static void main(String[] args) throws Exception {
        if (args.length < 4) {
            System.out.println("usage: java this <device> <kind> <group> <port>");
            return;
        }
        devicer lin = devicer.getRecord(args[0]);
        packet knd = packer.sender(args[2], args[3]).string2kind(args[1]);
        byte[] buf = new byte[consts.payl];
        for (;;) {
            int i = lin.read(buf);
            if (i < 1) {
                break;
            }
            knd.writeKind(buf, i);
        }
    }

}
