public void createPong()

in src/main/java/com/microsoft/azure/proton/transport/ws/impl/WebSocketHandlerImpl.java [39:58]


    public void createPong(ByteBuffer ping, ByteBuffer pong) {
        if ((ping == null) || (pong == null)) {
            throw new IllegalArgumentException("input parameter cannot be null");
        }

        if (ping.capacity() > pong.capacity()) {
            throw new IllegalArgumentException("insufficient output buffer size");
        }

        if (ping.remaining() > 0) {
            byte[] buffer = ping.array();
            buffer[0] = WebSocketHeader.FINBIT_MASK | WebSocketHeader.OPCODE_PONG;

            pong.clear();
            pong.put(buffer);
        } else {
            pong.clear();
            pong.limit(0);
        }
    }