-
Notifications
You must be signed in to change notification settings - Fork 5
kiwi.io.BufferedReader
BufferedReader reads text from a character-input stream, buffering characters so as to provide for the efficient reading of characters, arrays, and lines.
CAUTION: Although the following code example explains how to read a Unicode file, BufferedReader does not currently support Unicode text files.
constructor(byref reader as InputStreamReader)Creates a new BufferedReader instance @param reader is the input reader to use with this buffered reader
function BufferedReader.OpenStream() as BooleanOpens the Input Stream
@return true if file exists and can be read
function BufferedReader.OpenStream() as BooleanCloses the Input Stream
function BufferedReader.hasNextLine() as BooleanReturns true if this BufferedReader has a next line.
function BufferedReader.readLine() as StringReads a line of text. A line is considered to be terminated by any one of a line feed ('\n'), a carriage return ('\r'), a carriage return followed immediately by a line feed, or by reaching the end-of-file (EOF).
#include once "kiwi\kiwi.bi"
#include once "kiwi\io.bi" ' Include Kiwi's IO package
' Initialize a File and a FileReader
Dim myFile as File = File("C:\Users\nsiat\Desktop\Test.txt")
Dim myReader as FileReader = FileReader(myFile, Charset.UTF8) ' Use UTF-8 Charset
' Initialize a BufferedReader. The BufferedReader will be used to
' read the text file line-by-line
Dim bReader as BufferedReader = BufferedReader(myReader)
if bReader.OpenStream() = true then
while bReader.hasNextLine()
print bReader.readLine() ' Print each line of the text file
wend
bReader.CloseStream() ' Close the Stream
else
print "Unable to open the file! Check if file is saved as 'UTF-8-BOM'"
end if- MySQL/MariaDB - Coming to v1.0.2
- ArrayList
- Comparator
- HashMap - Coming to v1.0.2
- Queue