public long getFieldOffset(String name) {
        long offset = 0;
        for(Field field : fields) {
            if (field.name.equals(name)) {
                return offset;
            } else {
                offset += field.offset;
            }
        }

        return -1;
    }