Top Fields Constructors Methods
org.wildfly.client.config

pack-priv final Class CountingReader

extends Reader
Class Inheritance
Imports
java.io.IOException, .Reader

Author
David M. Lloyd

Field Summary

Modifier and TypeField and Description
private int
private int
private int
private final Reader
Inherited from java.io.Reader:
lock

Constructor Summary

AccessConstructor and Description
pack-priv
CountingReader(final Reader reader)

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements abstract java.io.Reader.close.

Implements java.io.Closeable.close.

Closes the stream and releases any system resources associated with it.
public int
public int
public int
private void
processChar(final int ch)

public int
read()

Overrides java.io.Reader.read.

Reads a single character.
public int
read(final char[]
Destination buffer
cbuf
)

Overrides java.io.Reader.read.

Reads characters into an array.
public int
read(final char[]
Destination buffer
cbuf
,
final int
Offset at which to start storing characters
off
,
final int
Maximum number of characters to read
len
)

Implements abstract java.io.Reader.read.

Reads characters into a portion of an array.
Inherited from java.io.Reader:
markmarkSupportednullReaderreadreadyresetskiptransferTo

Field Detail

characterOffsetback to summary
private int characterOffset
columnNumberback to summary
private int columnNumber
lineNumberback to summary
private int lineNumber
readerback to summary
private final Reader reader

Constructor Detail

CountingReaderback to summary
pack-priv CountingReader(final Reader reader)

Method Detail

closeback to summary
public void close() throws IOException

Implements abstract java.io.Reader.close.

Implements java.io.Closeable.close.

Doc from java.io.Reader.close.

Closes the stream and releases any system resources associated with it. Once the stream has been closed, further read(), ready(), mark(), reset(), or skip() invocations will throw an IOException. Closing a previously closed stream has no effect.

Exceptions
IOException:
If an I/O error occurs
getCharacterOffsetback to summary
public int getCharacterOffset()
getColumnNumberback to summary
public int getColumnNumber()
getLineNumberback to summary
public int getLineNumber()
processCharback to summary
private void processChar(final int ch)
readback to summary
public int read() throws IOException

Overrides java.io.Reader.read.

Doc from java.io.Reader.read.

Reads a single character. This method will block until a character is available, an I/O error occurs, or the end of the stream is reached.

Subclasses that intend to support efficient single-character input should override this method.

Returns:int

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(final char[] cbuf) throws IOException

Overrides java.io.Reader.read.

Doc from java.io.Reader.read.

Reads characters into an array. This method will block until some input is available, an I/O error occurs, or the end of the stream is reached.

If the length of cbuf is zero, then no characters are read and 0 is returned; otherwise, there is an attempt to read at least one character. If no character is available because the stream is at its end, the value -1 is returned; otherwise, at least one character is read and stored into cbuf.

Parameters
cbuf:char[]

Destination buffer

Returns:int

The number of characters read, 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(final char[] cbuf, final int off, final int len) throws IOException

Implements abstract java.io.Reader.read.

Doc from java.io.Reader.read.

Reads characters into a portion of an array. This method will block until some input is available, an I/O error occurs, or the end of the stream is reached.

If len is zero, then no characters are read and 0 is returned; otherwise, there is an attempt to read at least one character. If no character is available because the stream is at its end, the value -1 is returned; otherwise, at least one character is read and stored into cbuf.

Parameters
cbuf:char[]

Destination buffer

off:int

Offset at which to start storing characters

len:int

Maximum number of characters to read

Returns:int

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

Exceptions
IOException:
If an I/O error occurs