@Test public void setAroWebPLib() { reader.setAroWebPLib("Windows", "64"); String libname = reader.getAroWebPLibFileName(); assertEquals("webp-imageio.dll", libname); reader.setAroWebPLib("Windows", "86"); libname = reader.getAroWebPLibFileName(); assertEquals("webp-imageio32.dll", libname); reader.setAroWebPLib("Linux", "amd64"); libname = reader.getAroWebPLibFileName(); assertEquals("libwebp-imageio.so", libname); reader.setAroWebPLib("Linux", "i386"); libname = reader.getAroWebPLibFileName(); assertEquals("libwebp-imageio32.so", libname); reader.setAroWebPLib("MacOS", "64"); libname = reader.getAroWebPLibFileName(); assertEquals("libwebp-imageio.dylib", libname); reader.setAroWebPLib(null, null); libname = reader.getAroWebPLibFileName(); assertEquals("libwebp-imageio.dylib", libname); }
public void setAroWebPLib(String osname, String osarch) { LOGGER.info("OS: " + osname); LOGGER.info("OS Arch: " + osarch); if (osname != null && osarch != null) { if (osname.contains(windowsOS) && osarch.contains("64")) { aroWebPLibName = "webp-imageio"; aroWebPLibFileName = aroWebPLibName + windowsExtn ; } else if (osname.contains(windowsOS)) { aroWebPLibName = "webp-imageio32"; aroWebPLibFileName = aroWebPLibName + windowsExtn; } else if (osname.contains(linuxOS) && osarch.contains("amd64")) { aroWebPLibName = "libwebp-imageio"; aroWebPLibFileName = aroWebPLibName + unixExtn; } else if (osname.contains(linuxOS) && osarch.contains("i386")) { aroWebPLibName = "libwebp-imageio32"; aroWebPLibFileName = aroWebPLibName + unixExtn; } else { aroWebPLibName = "libwebp-imageio"; aroWebPLibFileName = aroWebPLibName + ".dylib"; } } LOGGER.debug("ARO WebP DLL lib file name: " + aroWebPLibFileName); }
PacketReaderImpl implements IPacketReader, INativePacketSubscriber { public void setAroWebPLib(String osname, String osarch) { LOGGER.info("OS: " + osname); LOGGER.info("OS Arch: " + osarch); if (osname != null && osarch != null) { if (osname.contains(windowsOS) && osarch.contains("64")) { aroWebPLibName = "webp-imageio"; aroWebPLibFileName = aroWebPLibName + windowsExtn ; } else if (osname.contains(windowsOS)) { aroWebPLibName = "webp-imageio32"; aroWebPLibFileName = aroWebPLibName + windowsExtn; } else if (osname.contains(linuxOS) && osarch.contains("amd64")) { aroWebPLibName = "libwebp-imageio"; aroWebPLibFileName = aroWebPLibName + unixExtn; } else if (osname.contains(linuxOS) && osarch.contains("i386")) { aroWebPLibName = "libwebp-imageio32"; aroWebPLibFileName = aroWebPLibName + unixExtn; } else { aroWebPLibName = "libwebp-imageio"; aroWebPLibFileName = aroWebPLibName + ".dylib"; } } LOGGER.debug("ARO WebP DLL lib file name: " + aroWebPLibFileName); } }
PacketReaderImpl implements IPacketReader, INativePacketSubscriber { public void setAroWebPLib(String osname, String osarch) { LOGGER.info("OS: " + osname); LOGGER.info("OS Arch: " + osarch); if (osname != null && osarch != null) { if (osname.contains(windowsOS) && osarch.contains("64")) { aroWebPLibName = "webp-imageio"; aroWebPLibFileName = aroWebPLibName + windowsExtn ; } else if (osname.contains(windowsOS)) { aroWebPLibName = "webp-imageio32"; aroWebPLibFileName = aroWebPLibName + windowsExtn; } else if (osname.contains(linuxOS) && osarch.contains("amd64")) { aroWebPLibName = "libwebp-imageio"; aroWebPLibFileName = aroWebPLibName + unixExtn; } else if (osname.contains(linuxOS) && osarch.contains("i386")) { aroWebPLibName = "libwebp-imageio32"; aroWebPLibFileName = aroWebPLibName + unixExtn; } else { aroWebPLibName = "libwebp-imageio"; aroWebPLibFileName = aroWebPLibName + ".dylib"; } } LOGGER.debug("ARO WebP DLL lib file name: " + aroWebPLibFileName); } PacketReaderImpl(); }
PacketReaderImpl implements IPacketReader, INativePacketSubscriber { public void setAroWebPLib(String osname, String osarch) { LOGGER.info("OS: " + osname); LOGGER.info("OS Arch: " + osarch); if (osname != null && osarch != null) { if (osname.contains(windowsOS) && osarch.contains("64")) { aroWebPLibName = "webp-imageio"; aroWebPLibFileName = aroWebPLibName + windowsExtn ; } else if (osname.contains(windowsOS)) { aroWebPLibName = "webp-imageio32"; aroWebPLibFileName = aroWebPLibName + windowsExtn; } else if (osname.contains(linuxOS) && osarch.contains("amd64")) { aroWebPLibName = "libwebp-imageio"; aroWebPLibFileName = aroWebPLibName + unixExtn; } else if (osname.contains(linuxOS) && osarch.contains("i386")) { aroWebPLibName = "libwebp-imageio32"; aroWebPLibFileName = aroWebPLibName + unixExtn; } else { aroWebPLibName = "libwebp-imageio"; aroWebPLibFileName = aroWebPLibName + ".dylib"; } } LOGGER.debug("ARO WebP DLL lib file name: " + aroWebPLibFileName); } PacketReaderImpl(); void setAdapter(PCapAdapter adapter); @Override void readPacket(String packetfile, IPacketListener listener); void setVOLibName(); void setAroJpcapLibName(String osname, String osarch); String getAroJpcapLibFileName(); String getAroWebPLibName(); void setAroWebPLib(String osname, String osarch); String getAroWebPLibFileName(); @Override void receive(int datalink, long seconds, long microSeconds, int len, byte[] data); }
PacketReaderImpl implements IPacketReader, INativePacketSubscriber { public void setAroWebPLib(String osname, String osarch) { LOGGER.info("OS: " + osname); LOGGER.info("OS Arch: " + osarch); if (osname != null && osarch != null) { if (osname.contains(windowsOS) && osarch.contains("64")) { aroWebPLibName = "webp-imageio"; aroWebPLibFileName = aroWebPLibName + windowsExtn ; } else if (osname.contains(windowsOS)) { aroWebPLibName = "webp-imageio32"; aroWebPLibFileName = aroWebPLibName + windowsExtn; } else if (osname.contains(linuxOS) && osarch.contains("amd64")) { aroWebPLibName = "libwebp-imageio"; aroWebPLibFileName = aroWebPLibName + unixExtn; } else if (osname.contains(linuxOS) && osarch.contains("i386")) { aroWebPLibName = "libwebp-imageio32"; aroWebPLibFileName = aroWebPLibName + unixExtn; } else { aroWebPLibName = "libwebp-imageio"; aroWebPLibFileName = aroWebPLibName + ".dylib"; } } LOGGER.debug("ARO WebP DLL lib file name: " + aroWebPLibFileName); } PacketReaderImpl(); void setAdapter(PCapAdapter adapter); @Override void readPacket(String packetfile, IPacketListener listener); void setVOLibName(); void setAroJpcapLibName(String osname, String osarch); String getAroJpcapLibFileName(); String getAroWebPLibName(); void setAroWebPLib(String osname, String osarch); String getAroWebPLibFileName(); @Override void receive(int datalink, long seconds, long microSeconds, int len, byte[] data); public String windowsOS; public String windowsExtn; public String linuxOS; }