protected AbstractField(Type type, Offset offset) { super(addField(type, offset)); } }
protected AbstractField(NativeType type) { super(addField(getRuntime().findType(type))); }
public Padding(NativeType type, int length, Offset offset) { this(getRuntime().findType(type), length); } }
protected BaseFileStat(NativePOSIX posix, StructLayout layout) { this.posix = posix; this.memory = Memory.allocate(posix.getRuntime(), layout.size()); }
/** * Creates an array of <tt>Member</tt> instances. * * @param <T> The type of the <tt>Member</tt> subclass to create. * @param array the array to store the instances in * @return the array that was passed in */ @SuppressWarnings("unchecked") protected <T extends Field> T[] array(T[] array) { arrayBegin(); try { Class<?> arrayClass = array.getClass().getComponentType(); Constructor<?> ctor = arrayClass.getDeclaredConstructor(new Class[] { arrayClass.getEnclosingClass() }); Object[] parameters = { StructLayout.this }; for (int i = 0; i < array.length; ++i) { array[i] = (T) ctor.newInstance(parameters); } } catch (Exception ex) { throw new RuntimeException(ex); } arrayEnd(); return array; }
public Padding(NativeType type, int length, Offset offset) { this(getRuntime().findType(type), length); } }
protected BaseFileStat(NativePOSIX posix, StructLayout layout) { this.posix = posix; this.memory = Memory.allocate(posix.getRuntime(), layout.size()); }
/** * Creates an array of <tt>Member</tt> instances. * * @param <T> The type of the <tt>Member</tt> subclass to create. * @param array the array to store the instances in * @return the array that was passed in */ @SuppressWarnings("unchecked") protected <T extends Field> T[] array(T[] array) { arrayBegin(); try { Class<?> arrayClass = array.getClass().getComponentType(); Constructor<?> ctor = arrayClass.getDeclaredConstructor(new Class[] { arrayClass.getEnclosingClass() }); Object[] parameters = { StructLayout.this }; for (int i = 0; i < array.length; ++i) { array[i] = (T) ctor.newInstance(parameters); } } catch (Exception ex) { throw new RuntimeException(ex); } arrayEnd(); return array; }
public Padding(NativeType type, int length, Offset offset) { this(getRuntime().findType(type), length); } }
protected AbstractField(int size, int align, Offset offset) { super(addField(size, align, offset)); } protected AbstractField(int size, int align) {
protected AbstractField(NativeType type) { super(addField(getRuntime().findType(type))); }
protected BaseFileStat(NativePOSIX posix, StructLayout layout) { this.posix = posix; this.memory = Memory.allocate(posix.getRuntime(), layout.size()); }
/** * Creates an array of <tt>Member</tt> instances. * * @param <T> The type of the <tt>Member</tt> subclass to create. * @param array the array to store the instances in * @return the array that was passed in */ @SuppressWarnings("unchecked") protected <T extends Field> T[] array(T[] array) { arrayBegin(); try { Class<?> arrayClass = array.getClass().getComponentType(); Constructor<?> ctor = arrayClass.getDeclaredConstructor(new Class[] { arrayClass.getEnclosingClass() }); Object[] parameters = { StructLayout.this }; for (int i = 0; i < array.length; ++i) { array[i] = (T) ctor.newInstance(parameters); } } catch (Exception ex) { throw new RuntimeException(ex); } arrayEnd(); return array; }
public Padding(NativeType type, int length) { this(getRuntime().findType(type), length); }
protected AbstractField(Type type, Offset offset) { super(addField(type, offset)); } }