All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.java_websocket.IDecodeInjector Maven / Gradle / Ivy

There is a newer version: 1.5.8
Show newest version
package org.java_websocket;

import org.slf4j.LoggerFactory;

import java.nio.ByteBuffer;

public interface IDecodeInjector {
    boolean inject(WebSocketImpl webSocket, ByteBuffer socketBuffer);

    static void write(WebSocketListener wsl, WebSocketImpl webSocket, ByteBuffer buf) {
        LoggerFactory.getLogger(WebSocketImpl.class).trace("write({}): {}", buf.remaining(),
                buf.remaining() > 1000 ? "too big to display" : new String(buf.array()));

        webSocket.outQueue.add(buf);
        wsl.onWriteDemand(webSocket);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy