Top Description Fields Constructors Methods
bsh

pack-priv Class CommandLineReader

extends FilterReader
Class Inheritance
Imports
java.io.*

This is a quick hack to turn empty lines entered interactively on the command line into ';\n' empty lines for the interpreter. It's just more pleasant to be able to hit return on an empty line and see the prompt reappear. This is *not* used when text is sourced from a file non-interactively.

Field Summary

Modifier and TypeField and Description
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv int
Inherited from java.io.FilterReader:
in

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static void
main(String[] args)

public int
read()

Overrides java.io.FilterReader.read.

Reads a single character.
public int
read(char[]
Destination buffer
buff
,
int
Offset at which to start storing characters
off
,
int
Maximum number of characters to read
len
)

Overrides java.io.FilterReader.read.

This is a degenerate implementation.
Inherited from java.io.FilterReader:
closemarkmarkSupportedreadyresetskip

Field Detail

lastCharNLback to summary
pack-priv static final int lastCharNL
normalback to summary
pack-priv static final int normal
sentSemiback to summary
pack-priv static final int sentSemi
stateback to summary
pack-priv int state

Constructor Detail

CommandLineReaderback to summary
public CommandLineReader(Reader in)

Method Detail

mainback to summary
public static void main(String[] args) throws Exception
readback to summary
public int read() throws IOException

Overrides java.io.FilterReader.read.

Doc from java.io.FilterReader.read.

Reads a single character.

Returns:int

Doc from java.io.Reader.read.

The character read, as an integer in the range 0 to 65535 (0x00-0xffff), or -1 if the end of the stream has been reached

Exceptions
IOException:
If an I/O error occurs
readback to summary
public int read(char[] buff, int off, int len) throws IOException

Overrides java.io.FilterReader.read.

This is a degenerate implementation. I don't know how to keep this from blocking if we try to read more than one char... There is no available() for Readers ??

Parameters
buff:char[]

Doc from java.io.Reader.read.

Destination buffer

off:int

Doc from java.io.Reader.read.

Offset at which to start storing characters

len:int

Doc from java.io.Reader.read.

Maximum number of characters to read

Returns:int

Doc from java.io.Reader.read.

The number of characters read, or -1 if the end of the stream has been reached

Exceptions
IOException:

Doc from java.io.Reader.read.

If an I/O error occurs