/** * Send Binary data (plain bytes) to the other end. * * @throws IllegalArgumentException * @throws NotYetConnectedException */ @Override public void send(ByteBuffer bytes) throws IllegalArgumentException, WebsocketNotConnectedException { if (bytes == null) throw new IllegalArgumentException("Cannot send 'null' data to a WebSocketImpl."); send(draft.createFrames(bytes, role == Role.CLIENT)); }
/** * Send Text data to the other end. * * @throws IllegalArgumentException * @throws NotYetConnectedException */ @Override public void send(String text) throws WebsocketNotConnectedException { if (text == null) throw new IllegalArgumentException("Cannot send 'null' data to a WebSocketImpl."); send(draft.createFrames(text, role == Role.CLIENT)); }