jline
Class UnixTerminal.ReplayPrefixOneCharInputStream
java.lang.Object
java.io.InputStream
jline.UnixTerminal.ReplayPrefixOneCharInputStream
- All Implemented Interfaces:
- java.io.Closeable
- Enclosing class:
- UnixTerminal
static class UnixTerminal.ReplayPrefixOneCharInputStream
- extends java.io.InputStream
This is awkward and inefficient, but probably the minimal way to add
UTF-8 support to JLine
- Author:
- Marc Herbert
|
Method Summary |
int |
available()
InputStreamReader is greedy and will try to read bytes in advance. |
int |
read()
|
void |
setInput(int recorded,
java.io.InputStream wrapped)
|
void |
setInputUTF8(int recorded,
java.io.InputStream wrapped)
|
| Methods inherited from class java.io.InputStream |
close, mark, markSupported, read, read, reset, skip |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
firstByte
byte firstByte
byteLength
int byteLength
wrappedStream
java.io.InputStream wrappedStream
byteRead
int byteRead
encoding
final java.lang.String encoding
UnixTerminal.ReplayPrefixOneCharInputStream
public UnixTerminal.ReplayPrefixOneCharInputStream(java.lang.String encoding)
setInput
public void setInput(int recorded,
java.io.InputStream wrapped)
throws java.io.IOException
- Throws:
java.io.IOException
setInputUTF8
public void setInputUTF8(int recorded,
java.io.InputStream wrapped)
throws java.io.IOException
- Throws:
java.io.IOException
read
public int read()
throws java.io.IOException
- Specified by:
read in class java.io.InputStream
- Throws:
java.io.IOException
available
public int available()
- InputStreamReader is greedy and will try to read bytes in advance. We
do NOT want this to happen since we use a temporary/"losing bytes"
InputStreamReader above, that's why we hide the real
wrappedStream.available() here.
- Overrides:
available in class java.io.InputStream