Use WritableUtils.readVInt(in) and WritableUtils.writeVInt(out) instead. The in.readInt() and out.writeInt() will write a 4 byte int