public static void linkBA(Object obj, Object fieldName, Object stream, int size) {
        if (stream instanceof OutputStream) {
            try {
                Object val = null;
                if (fieldName instanceof String) {
                    val = getField(obj.getClass(), (String) fieldName).get(obj);
                    if (val instanceof Enum) {
                        val = ((Enum) val).ordinal();
                    }
                }
                if (fieldName instanceof Integer) {
                    val = fieldName;
                }

                Method method = DoomIO.class.getMethod("toByteArray", val.getClass(), int.class);
                byte[] bytes = (byte[]) method.invoke(null, val, size);
                ((OutputStream) stream).write(bytes);

            } catch (Exception e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }

        if (stream instanceof InputStream) {
            try {
                if (fieldName instanceof String) {
                    Field field = obj.getClass().getField((String) fieldName);
                    assigner(obj, field, (InputStream) stream, size);
                }
                if (fieldName instanceof Integer) {
                    ((InputStream) stream).read(new byte[size]);
                }

            } catch (Exception e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }


//		    	public static int freadint(InputStream file, int nbBytes) throws IOException {

    }