public class yyInputStream
extends java.io.InputStream
implements java.awt.event.KeyListener
TextArea
.
Feeds all read methods from listening to typed keys.
Should not deadlock because one should generally not
read from within the event thread.Modifier and Type | Field and Description |
---|---|
protected java.lang.StringBuffer |
line
line edit buffer.
|
protected java.util.ArrayList |
queue
completed lines, ready to be read.
|
Constructor and Description |
---|
yyInputStream() |
Modifier and Type | Method and Description |
---|---|
int |
available() |
void |
close() |
void |
keyPressed(java.awt.event.KeyEvent ke)
this one ensures that you can only type at the end.
|
void |
keyReleased(java.awt.event.KeyEvent ke) |
void |
keyTyped(java.awt.event.KeyEvent ke) |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
long |
skip(long len)
returns 0: cannot skip on a terminal.
|
protected final java.lang.StringBuffer line
protected java.util.ArrayList queue
close()
.public int available() throws java.io.IOException
available
in class java.io.InputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.InputStream
java.io.IOException
public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public int read(byte[] b, int off, int len) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public long skip(long len)
skip
in class java.io.InputStream
public void keyPressed(java.awt.event.KeyEvent ke)
keyPressed
in interface java.awt.event.KeyListener
public void keyTyped(java.awt.event.KeyEvent ke)
keyTyped
in interface java.awt.event.KeyListener
public void keyReleased(java.awt.event.KeyEvent ke)
keyReleased
in interface java.awt.event.KeyListener