jline

Class WindowsTerminal.ReplayPrefixOneCharInputStream

Enclosing Class:
WindowsTerminal

(package private) static class WindowsTerminal.ReplayPrefixOneCharInputStream
extends InputStream

This is awkward and inefficient, but probably the minimal way to add UTF-8 support to JLine
Author:
Marc Herbert

Field Summary

(package private) int
byteLength
(package private) int
byteRead
(package private) String
encoding
(package private) byte
firstByte
(package private) InputStream
wrappedStream

Constructor Summary

ReplayPrefixOneCharInputStream(String encoding)

Method Summary

int
available()
InputStreamReader is greedy and will try to read bytes in advance.
int
read()
void
setInput(int recorded, InputStream wrapped)
void
setInputUTF8(int recorded, InputStream wrapped)

Field Details

byteLength

(package private)  int byteLength

byteRead

(package private)  int byteRead

encoding

(package private) final String encoding

firstByte

(package private)  byte firstByte

wrappedStream

(package private)  InputStream wrappedStream

Constructor Details

ReplayPrefixOneCharInputStream

public ReplayPrefixOneCharInputStream(String encoding)

Method Details

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.

read

public int read()
            throws IOException

setInput

public void setInput(int recorded,
                     InputStream wrapped)
            throws IOException

setInputUTF8

public void setInputUTF8(int recorded,
                         InputStream wrapped)
            throws IOException