jline.internal
Class ReplayPrefixOneCharInputStream
java.lang.Object
java.io.InputStream
jline.internal.ReplayPrefixOneCharInputStream
- All Implemented Interfaces:
- Closeable
public final class ReplayPrefixOneCharInputStream
- extends InputStream
This is awkward and inefficient, but probably the minimal way to add UTF-8 support to JLine
- Since:
- 2.0
- Author:
- Marc Herbert, Jason Dillon
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReplayPrefixOneCharInputStream
public ReplayPrefixOneCharInputStream(String encoding)
getEncoding
public String getEncoding()
setInput
public void setInput(int recorded,
InputStream wrapped)
throws IOException
- Throws:
IOException
setInputUTF8
public void setInputUTF8(int recorded,
InputStream wrapped)
throws IOException
- Throws:
IOException
read
public int read()
throws IOException
- Specified by:
read
in class InputStream
- Throws:
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 InputStream
Copyright © 2008-2011 Sonatype. All Rights Reserved.