Iris/src/main/java/NioEchoExample.java
@Override
            public void tcpDataReceived(NioServer.Event evt) {
                ByteBuffer inBuff = evt.getInputBuffer();               // Input buffer

                inBuff.mark();                                          // Remember where we started
                System.out.print( charset.decode( inBuff ) );           // Echo to console
                inBuff.reset();                                         // Back to the mark

                ByteBuffer outBuff = evt.getOutputBuffer();             // Output buffer
                outBuff.clear();                                        // Clear output
                outBuff.put( inBuff );                                  // Copy input into output
                outBuff.flip();                                         // Prepare output for playback
            }
/**
             * Echo all TCP data as it is received.
             */
Echo all TCP data as it is received.
Echo all TCP data as it is received .
@Override
            public void tcpDataReceived(NioServer.Event evt) {
                ByteBuffer inBuff = evt.getInputBuffer();               
                inBuff.mark();                                          
                System.out.print( charset.decode( inBuff ) );           
                inBuff.reset();                                         
                ByteBuffer outBuff = evt.getOutputBuffer();             
                outBuff.clear();                                        
                outBuff.put( inBuff );                                  
                outBuff.flip();                                         
            }
@ Override public void tcpDataReceived ( NioServer . Event evt ) { ByteBuffer inBuff = evt . getInputBuffer ( ) ; inBuff . mark ( ) ; System . out . print ( charset . decode ( inBuff ) ) ; inBuff . reset ( ) ; ByteBuffer outBuff = evt . getOutputBuffer ( ) ; outBuff . clear ( ) ; outBuff . put ( inBuff ) ; outBuff . flip ( ) ; }
Echo all TCP data as it is received.
Echo all TCP data as it is received .
// Input buffer // Remember where we started // Echo to console // Back to the mark // Output buffer // Clear output // Copy input into output // Prepare output for playback