int pcAlign = pathconf(storageDir, _PC_REC_XFER_ALIGN).intValue();
private Timestamp buildTimestamp(Pointer header) { Timestamp ts = new Timestamp(pcap_pkthdr.getTvSec(header).longValue() * 1000L); switch (timestampPrecision) { case MICRO: ts.setNanos(pcap_pkthdr.getTvUsec(header).intValue() * 1000); break; case NANO: ts.setNanos(pcap_pkthdr.getTvUsec(header).intValue()); break; default: throw new AssertionError("Never get here."); } return ts; }
/** * Set <code>value</code> at location being pointed to. This is equivalent * to the expression * <code>*((long *)((char *)Pointer + offset)) = value</code>. * * @param offset byte offset from pointer at which <code>value</code> * must be set * @param value <code>long</code> value to set */ public void setNativeLong(long offset, NativeLong value) { if (NativeLong.SIZE == 8) { setLong(offset, value.longValue()); } else { setInt(offset, value.intValue()); } }
public void update(jtermios.Termios t) { t.c_iflag = c_iflag.intValue(); t.c_oflag = c_oflag.intValue(); t.c_cflag = c_cflag.intValue(); t.c_lflag = c_lflag.intValue(); System.arraycopy(c_cc, 0, t.c_cc, 0, Math.min(t.c_cc.length, c_cc.length)); t.c_ispeed = c_ispeed.intValue(); t.c_ospeed = c_ospeed.intValue(); } }
public void update(jtermios.Termios t) { t.c_iflag = c_iflag.intValue(); t.c_oflag = c_oflag.intValue(); t.c_cflag = c_cflag.intValue(); t.c_lflag = c_lflag.intValue(); System.arraycopy(c_cc, 0, t.c_cc, 0, Math.min(t.c_cc.length, c_cc.length)); t.c_ispeed = c_ispeed.intValue(); t.c_ospeed = c_ospeed.intValue(); } }
protected GCallback(NativeLong id, Callback cb) { this.id = id != null ? id : new NativeLong(0); this.cb = cb; this.connected = this.id.intValue() != 0; } void remove() {
/** * Convert a long value to it's corresponding EDS error. * @param value */ public static EdsError toEdsError( final NativeLong value ) { return CanonUtils.toEdsError( value.intValue() ); }
protected GCallback(NativeLong id, Callback cb) { this.id = id != null ? id : new NativeLong(0); this.cb = cb; this.connected = this.id.intValue() != 0; } void remove() {
synchronized protected void disconnect() { if (id != null && id.intValue() != 0) { GOBJECT_API.g_signal_handler_disconnect(GObject.this, id); id = null; } } @Override
synchronized protected void disconnect() { if (id != null && id.intValue() != 0) { GOBJECT_API.g_signal_handler_disconnect(GObject.this, id); id = null; } } @Override
public void callback(Pointer context, int result, Pointer sender, int reportType, int reportID, Pointer report, NativeLong report_length) { //System.out.println("HidReportCallback "+Thread.currentThread().getName()); HidDevice dev = m_DevFromCallback.get(this); if (dev != null) { if (dev.m_InputReportListener != null) { int length = report_length.intValue(); report.read(0, dev.m_InputReportData, 0, length); dev.m_InputReportListener.onInputReport(dev, (byte) reportID, dev.m_InputReportData, length); } } else System.err.println("HidReportCallback could not get the HidDevice object"); } }
public Point getLocation() { NativeLongByReference x = new NativeLongByReference(); NativeLongByReference y = new NativeLongByReference(); int result = lib.wdeGetLocation(element, x, y); errors.verifyErrorCode(result, "Unable to get location of element"); return new Point(x.getValue().intValue(), y.getValue().intValue()); }
public Dimension getSize() { NativeLongByReference width = new NativeLongByReference(); NativeLongByReference height = new NativeLongByReference(); int result = lib.wdeGetSize(element, width, height); errors.verifyErrorCode(result, "Unable to get element size"); return new Dimension(width.getValue().intValue(), height.getValue().intValue()); }
public static int IOHIDDeviceGetReport(IOHIDDeviceRef device, int reportType, int reportID, ByteBuffer report, int[] pReportLength) { NativeLong[] t = { new NativeLong(pReportLength[0]) }; int res = INSTANCE.IOHIDDeviceGetReport(device, reportType, new NativeLong(reportID), report, t); pReportLength[0] = t[0].intValue(); return res; }
public Point getLocationOnScreenOnceScrolledIntoView() { HWNDByReference hwnd = new HWNDByReference(); NativeLongByReference x = new NativeLongByReference(); NativeLongByReference y = new NativeLongByReference(); NativeLongByReference width = new NativeLongByReference(); NativeLongByReference height = new NativeLongByReference(); if (lib.wdeGetDetailsOnceScrolledOnToScreen(element, hwnd, x, y, width, height) != 0) { return null; } return new Point(x.getValue().intValue(), y.getValue().intValue()); }
public static EdsError setCapacity( final EdsCameraRef ref, final int capacity ) { final EdsCapacity.ByValue edsCapacity = new EdsCapacity.ByValue(); edsCapacity.bytesPerSector = new NativeLong( 512 ); edsCapacity.numberOfFreeClusters = new NativeLong( capacity / edsCapacity.bytesPerSector.intValue() ); edsCapacity.reset = 1; return CanonUtils.toEdsError( CanonCamera.EDSDK.EdsSetCapacity( ref, edsCapacity ) ); }