Package com.clickhouse.jdbc.parser

# Class SimpleCharStream

java.lang.Object
com.clickhouse.jdbc.parser.AbstractCharStream
com.clickhouse.jdbc.parser.SimpleCharStream

All Implemented Interfaces:
  `CharStream`

public class SimpleCharStream extends AbstractCharStream
An implementation of interface CharStream, where the stream is assumed to contain only ASCII characters (without unicode processing).

## Field Summary

### Fields inherited from class com.clickhouse.jdbc.parser.AbstractCharStream

`available, buffer, bufpos, bufsize, DEFAULT_BUF_SIZE, inBuf, maxNextCharInd, tokenBegin`

## Constructor Summary

Constructors
Constructor
Description
`SimpleCharStream(InputStream dstream, Charset encoding)`
Constructor.
`SimpleCharStream(InputStream dstream, Charset encoding, int startline, int startcolumn)`
Constructor.
`SimpleCharStream(InputStream dstream, Charset encoding, int startline, int startcolumn, int buffersize)`
Constructor.
`SimpleCharStream(Reader dstream)`
Constructor.
`SimpleCharStream(Reader dstream, int startline, int startcolumn)`
Constructor.
`SimpleCharStream(Reader dstream, int startline, int startcolumn, int buffersize)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`void`
`reInit(InputStream dstream, Charset encoding)`
Reinitialise.
`void`
`reInit(InputStream dstream, Charset encoding, int startline, int startcolumn)`
Reinitialise.
`void`
`reInit(InputStream dstream, Charset encoding, int startline, int startcolumn, int buffersize)`
Reinitialise.
`void`
`reInit(Reader dstream)`
Reinitialise.
`void`
`reInit(Reader dstream, int startline, int startcolumn)`
Reinitialise.
`void`
`reInit(Reader dstream, int startline, int startcolumn, int buffersize)`
Reinitialise.
`protected void`
`streamClose()`
Close the underlying stream.
`protected int`
`streamRead(char[] aBuf, int nOfs, int nLen)`
Read from the underlying stream.

### Methods inherited from class com.clickhouse.jdbc.parser.AbstractCharStream

`adjustBeginLineColumn, backup, beginToken, done, expandBuff, fillBuff, getBeginColumn, getBeginLine, getBufSizeAfterExpansion, getColumn, getEndColumn, getEndLine, getImage, getLine, getSuffix, getTabSize, internalAdjustBuffSize, internalSetBufLineColumn, internalUpdateLineColumn, isTrackLineColumn, readChar, reInit, setTabSize, setTrackLineColumn`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### SimpleCharStream

public SimpleCharStream(Reader dstream, int startline, int startcolumn, int buffersize)
Constructor.

### SimpleCharStream

public SimpleCharStream(Reader dstream, int startline, int startcolumn)
Constructor.

### SimpleCharStream

public SimpleCharStream(Reader dstream)
Constructor.

### SimpleCharStream

public SimpleCharStream(InputStream dstream, Charset encoding, int startline, int startcolumn, int buffersize)
Constructor.

### SimpleCharStream

public SimpleCharStream(InputStream dstream, Charset encoding, int startline, int startcolumn)
Constructor.

### SimpleCharStream

public SimpleCharStream(InputStream dstream, Charset encoding)
Constructor.

## Method Details

### reInit

public void reInit(Reader dstream, int startline, int startcolumn, int buffersize)
Reinitialise.

### reInit

public void reInit(Reader dstream, int startline, int startcolumn)
Reinitialise.

### reInit

public void reInit(Reader dstream)
Reinitialise.

### reInit

public void reInit(InputStream dstream, Charset encoding)
Reinitialise.

### reInit

public void reInit(InputStream dstream, Charset encoding, int startline, int startcolumn)
Reinitialise.

### reInit

public void reInit(InputStream dstream, Charset encoding, int startline, int startcolumn, int buffersize)
Reinitialise.

### streamRead

protected int streamRead(char[] aBuf, int nOfs, int nLen) throws IOException
Description copied from class: `AbstractCharStream`
Read from the underlying stream.

Specified by:
  `streamRead` in class `AbstractCharStream`
Parameters:
  `aBuf` - the buffer to be filled
  `nOfs` - The offset into the buffer. 0-based
  `nLen` - Number of chars to read.
Returns:
  Number of effective chars read, or -1 on error.
Throws:
  `IOException`

### streamClose

protected void streamClose() throws IOException
Description copied from class: `AbstractCharStream`
Close the underlying stream.

Specified by:
  `streamClose` in class `AbstractCharStream`
Throws:
  `IOException` - If closing fails.