@Override
    public int readInt(@Nonnull String fieldName) throws IOException {
        FieldDefinition fd = cd.getField(fieldName);
        if (fd == null) {
            return 0;
        }
        switch (fd.getType()) {
            case INT:
                return super.readInt(fieldName);
            case BYTE:
                return super.readByte(fieldName);
            case CHAR:
                return super.readChar(fieldName);
            case SHORT:
                return super.readShort(fieldName);
            default:
                throw createIncompatibleClassChangeError(fd, INT);
        }
    }
@Test
    public void testReadInt() throws Exception {
        int aByte = reader.readInt("byte");
        int aShort = reader.readInt("short");
        int aChar = reader.readInt("char");
        int aInt = reader.readInt("int");

        assertEquals(1, aByte);
        assertEquals(3, aShort);
        assertEquals(2, aChar);
        assertEquals(4, aInt);
        assertEquals(0, reader.readInt("NO SUCH FIELD"));

    }