/* a quick dirty hack to frob the endianness between esdmon and ices2 */

#include <unistd.h>

#define BUF_SIZE 1024
int main() {
    char buf[BUF_SIZE];
    while (1) {
	int got, i;
	got = read(0, buf, BUF_SIZE);
	for (i = 0; i < got; i += 2) {
	    int tmp = buf[i + 1];
	    buf[i + 1] = buf[i];
	    buf[i] = tmp;
	}
	write(1, buf, got);	
    }
}
