org.crsh.term.spi.net
Class TermIOServer

java.lang.Object
  extended by org.crsh.util.AbstractSocketServer
      extended by org.crsh.term.spi.net.TermIOServer
All Implemented Interfaces:
Closeable

public class TermIOServer
extends AbstractSocketServer

Author:
Julien Viet

Field Summary
private  TermIO delegate
          .
private  InputStream in
          .
private  OutputStream out
          .
private static Charset UTF_8
          .
 
Constructor Summary
TermIOServer(TermIO delegate, int bindingPort)
           
 
Method Summary
 boolean execute()
           
private  void flush()
           
protected  void handle(InputStream in, OutputStream out)
           
private  void iterate()
           
private  byte read()
           
private  int read(byte[] buffer, int off, int len)
           
private  void write(byte b)
           
private  void write(byte[] bytes)
           
 
Methods inherited from class org.crsh.util.AbstractSocketServer
accept, bind, close, getBindingPort, getPort
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UTF_8

private static final Charset UTF_8
.


delegate

private final TermIO delegate
.


in

private InputStream in
.


out

private OutputStream out
.

Constructor Detail

TermIOServer

public TermIOServer(TermIO delegate,
                    int bindingPort)
Method Detail

handle

protected void handle(InputStream in,
                      OutputStream out)
               throws IOException
Specified by:
handle in class AbstractSocketServer
Throws:
IOException

read

private byte read()
           throws IOException,
                  Done
Throws:
IOException
Done

read

private int read(byte[] buffer,
                 int off,
                 int len)
          throws IOException,
                 Done
Throws:
IOException
Done

write

private void write(byte b)
            throws IOException,
                   Done
Throws:
IOException
Done

write

private void write(byte[] bytes)
            throws IOException,
                   Done
Throws:
IOException
Done

flush

private void flush()
            throws IOException,
                   Done
Throws:
IOException
Done

execute

public boolean execute()
                throws IOException,
                       IllegalStateException
Throws:
IOException
IllegalStateException

iterate

private void iterate()
              throws IOException,
                     Done
Throws:
IOException
Done


Copyright © 2012 eXo Platform SAS. All Rights Reserved.