Code example for SocketChannel

Methods: write

0
        } catch (IOException ex) {}
    } 
 
    public final void write(String packet) throws IOException{
        packet+=(char)0x00;
        sock.write(ByteBuffer.wrap(packet.getBytes()));
    } 
 
    public final void send(String packet){
        server._out.send(this, packet);
    } 
 
    public final SelectionKey getKey(){
        return key;
    } 
 
    public final SocketChannel getSocket(){
        return sock;
    } 
 
    public final InputThread getServer(){