public boolean ping() throws IOException {
        try (Socket s = getSocket(); OutputStream os = s.getOutputStream()) {
            os.write(asBytes("zPING\0"));
            os.flush();
            try (InputStream is = s.getInputStream()) {
                byte[] buffer = new byte[4];
                int read = is.read(buffer);
                return read > 0 && Arrays.equals(buffer, asBytes("PONG"));
            }
        }
    }
Run PING command to CLAMD to test it is responding.

@return true if the server responded with proper ping reply.
@throws IOException if there is an I/O problem communicating with CLAMD
primefaces/src/main/java/org/primefaces/virusscan/impl/ClamDaemonClient.java