Maven module :un.api : api-encoding :
Class : un.api.io.CharInputStream
Extends/Implements : un.api.io.AbstractInputStream
Subclasses : -

Character input stream.
Wraps a ByteInpustStream and provide methods for Characters reading.
author  Johann Sorel


Variables : -
Functions : CharInputStream, CharInputStream, read, readChar, readChar, readChar, readLine, readLineAsBytes, close




New character input stream with '\n' end of line character.

@param in wrapped byte input stream, not null
@param encoding Character encoding to read in, not null
public void CharInputStream (ByteInputStream in, CharEncoding encoding)


New character input stream.
param  in wrapped byte input stream, not null
param  encoding Character encoding to read in, not null
param  endline End of line character, not null
public void CharInputStream (ByteInputStream in, CharEncoding encoding, Char endline)


Use with caution, this may break the char encoding offsets.
return  causes an IOException
throws  IOException
public int read ()


Read a single char.
return  Char or null if nothing left.
throws  IOException
public Char readChar ()


Read a single char, write it in given buffer
param  buffer byte buffer to copy character bytes, not null
param  offset offset in the byte buffer where to start writing character
return  number of bytes read, -1 if no more chars.
throws  IOException
public int readChar (byte[] buffer, int offset)


Read a single char, write it in given buffer
return  number of bytes read, -1 if no more chars.
throws  IOException
public int readChar (ByteSequence buffer)


Read a character sequence until it reached a new line character.
return  next line or null if nothing left.
throws  IOException
public Chars readLine ()


Read a character sequence as byte array
until it reached a new line character.
return  next line or null when finished.
throws  IOException
public byte[] readLineAsBytes ()


Close underlying stream.
throws  IOException
public void close ()