|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.crsh.term.spi.net.TermIOClient
public class TermIOClient
Field Summary | |
---|---|
private ByteBuffer |
buffer
. |
private byte[] |
bytes
. |
private InputStream |
in
. |
private OutputStream |
out
. |
private int |
port
. |
private Socket |
socket
. |
private static Charset |
UTF_8
. |
Constructor Summary | |
---|---|
TermIOClient(int port)
|
Method Summary | |
---|---|
private byte |
_read()
|
private int |
_read(byte[] buffer,
int off,
int len)
|
void |
close()
|
void |
connect()
|
CodeType |
decode(int code)
Decode the intput value. |
void |
flush()
Flush output. |
String |
getProperty(String name)
Retrieves the value of a property specified by this TermIO |
int |
getWidth()
Returns the term width in chars. |
boolean |
moveLeft()
Move the cursor left. |
boolean |
moveRight(char c)
Move the cursor right. |
private void |
put(byte b)
|
int |
read()
Reads an input value. |
void |
write(char c)
Write a char. |
void |
write(String s)
Write a string. |
void |
writeCRLF()
Write a CRLF. |
void |
writeDel()
Delete the char under the cursor. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final Charset UTF_8
private int port
private Socket socket
private InputStream in
private OutputStream out
private byte[] bytes
private ByteBuffer buffer
Constructor Detail |
---|
public TermIOClient(int port)
Method Detail |
---|
public void connect() throws IOException
IOException
private void put(byte b)
private int _read(byte[] buffer, int off, int len) throws IOException, Done
IOException
Done
private byte _read() throws IOException, Done
IOException
Done
public int read() throws IOException
TermIO
read
in interface TermIO
IOException
- any io exceptionpublic int getWidth()
TermIO
getWidth
in interface TermIO
public String getProperty(String name)
TermIO
getProperty
in interface TermIO
name
- the name of the property
public CodeType decode(int code)
TermIO
decode
in interface TermIO
code
- the code
public void close()
close
in interface Closeable
public void flush() throws IOException
TermIO
flush
in interface TermIO
IOException
- any io exceptionpublic void write(char c) throws IOException
TermIO
write
in interface TermIO
c
- the char to write
IOException
- any io exceptionpublic void write(String s) throws IOException
TermIO
write
in interface TermIO
s
- the string to write
IOException
- any io exceptionpublic void writeDel() throws IOException
TermIO
writeDel
in interface TermIO
IOException
- any io exceptionpublic void writeCRLF() throws IOException
TermIO
writeCRLF
in interface TermIO
IOException
- any io exceptionpublic boolean moveRight(char c) throws IOException
TermIO
moveRight
in interface TermIO
c
- the char skipped over
IOException
- any io exceptionpublic boolean moveLeft() throws IOException
TermIO
moveLeft
in interface TermIO
IOException
- any io exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |