Package com.sun.jna.ptr

Examples of com.sun.jna.ptr.ShortByReference


        }
    }

    @Override
    public List<GenericTerminal> list() throws ScardException {
        ShortByReference requiredSize = new ShortByReference();
        NativeLong status = win32PCSC.SCardListReadersW(new NativeLong(contextId), null, null, requiredSize);
        List<GenericTerminal> terminalsList;
        if (SCARD_E_NO_READERS_AVAILABLE == status.longValue()) {
            terminalsList = new ArrayList<GenericTerminal>(0);
            return Collections.unmodifiableList(terminalsList);
        }
        if (SCARD_S_SUCCESS != status.longValue()) {
            throw new PcScException(status.intValue());
        }
        short nativeOut[] = new short[requiredSize.getValue()];
        status = win32PCSC.SCardListReadersW(new NativeLong(contextId), null, nativeOut, requiredSize);
        if (SCARD_S_SUCCESS != status.longValue()) {
            throw new PcScException(status.intValue());
        }
        String[] readerNames=AStringUtilities.shortsToStrings(nativeOut);
View Full Code Here


        ByteByReference bref = new ByteByReference();
        lib.incrementInt8ByReference(bref);
        assertEquals("Byte argument not modified", 1, bref.getValue());
    }
    public void testShortByReference() {
        ShortByReference sref = new ShortByReference();
        lib.incrementInt16ByReference(sref);
        assertEquals("Short argument not modified", 1, sref.getValue());
    }
View Full Code Here

                        val = new Integer(Integer.parseInt((String)val)).shortValue();
                    } else {
                        throw new RuntimeException("Attempt to pass ineligible value to short: "+val);
                    }
                }
                return new ShortByReference((Short)val);
               
            case 'l':
            case 'L':
            case 'q':
            case 'Q':
View Full Code Here

        ByteByReference bref = new ByteByReference();
        lib.incrementInt8ByReference(bref);
        assertEquals("Byte argument not modified", 1, bref.getValue());
    }
    public void testShortByReference() {
        ShortByReference sref = new ShortByReference();
        lib.incrementInt16ByReference(sref);
        assertEquals("Short argument not modified", 1, sref.getValue());
    }
View Full Code Here

  public SocketAddress getListenAddress()
  {
    final int ADDR_LEN      = 40 * Constant.CHAR_SIZE;
    byte[] lpszAddress      = new byte[ADDR_LEN];
    IntByReference piAddressLen  = new IntByReference(ADDR_LEN);
    ShortByReference pusPort  = new ShortByReference();
   
    boolean isOK = HPSocket.SDK.HP_Server_GetListenAddress(socketObj, lpszAddress, piAddressLen, pusPort);
    return SocketAddress.craete(isOK, lpszAddress, piAddressLen, pusPort, false);
  }
View Full Code Here

  public SocketAddress getRemoteAddress(NativeLong dwConnID)
  {
    final int ADDR_LEN      = 40 * Constant.CHAR_SIZE;
    byte[] lpszAddress      = new byte[ADDR_LEN];
    IntByReference piAddressLen  = new IntByReference(ADDR_LEN);
    ShortByReference pusPort  = new ShortByReference();
   
    boolean isOK = HPSocket.SDK.HP_Server_GetRemoteAddress(socketObj, dwConnID, lpszAddress, piAddressLen, pusPort);
    return SocketAddress.craete(isOK, lpszAddress, piAddressLen, pusPort, false);
  }
View Full Code Here

  public SocketAddress getListenAddress()
  {
    final int ADDR_LEN      = 40 * Constant.WCHAR_SIZE;
    byte[] lpszAddress      = new byte[ADDR_LEN];
    IntByReference piAddressLen  = new IntByReference(ADDR_LEN);
    ShortByReference pusPort  = new ShortByReference();
   
    boolean isOK = HPSocket.SDK.HP_Server_GetListenAddress(socketObj, lpszAddress, piAddressLen, pusPort);
    return SocketAddress.craete(isOK, lpszAddress, piAddressLen, pusPort, true);
  }
View Full Code Here

  public SocketAddress getRemoteAddress(NativeLong dwConnID)
  {
    final int ADDR_LEN      = 40 * Constant.WCHAR_SIZE;
    byte[] lpszAddress      = new byte[ADDR_LEN];
    IntByReference piAddressLen  = new IntByReference(ADDR_LEN);
    ShortByReference pusPort  = new ShortByReference();
   
    boolean isOK = HPSocket.SDK.HP_Server_GetRemoteAddress(socketObj, dwConnID, lpszAddress, piAddressLen, pusPort);
    return SocketAddress.craete(isOK, lpszAddress, piAddressLen, pusPort, true);
  }
View Full Code Here

  public SocketAddress getLocalAddress()
  {
    final int ADDR_LEN      = 40 * Constant.CHAR_SIZE;
    byte[] lpszAddress      = new byte[ADDR_LEN];
    IntByReference piAddressLen  = new IntByReference(ADDR_LEN);
    ShortByReference pusPort  = new ShortByReference();
   
    boolean isOK = HPSocket.SDK.HP_Client_GetLocalAddress(socketObj, lpszAddress, piAddressLen, pusPort);
    return SocketAddress.craete(isOK, lpszAddress, piAddressLen, pusPort, false);
  }
View Full Code Here

  public SocketAddress getLocalAddress()
  {
    final int ADDR_LEN      = 40 * Constant.WCHAR_SIZE;
    byte[] lpszAddress      = new byte[ADDR_LEN];
    IntByReference piAddressLen  = new IntByReference(ADDR_LEN);
    ShortByReference pusPort  = new ShortByReference();
   
    boolean isOK = HPSocket.SDK.HP_Client_GetLocalAddress(socketObj, lpszAddress, piAddressLen, pusPort);
    return SocketAddress.craete(isOK, lpszAddress, piAddressLen, pusPort, true);
  }
View Full Code Here

TOP

Related Classes of com.sun.jna.ptr.ShortByReference

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.