public class TextRecordChannel extends Object
Allows performing record I/O operations.
A readRecord will have a readRecord separator and a field separator.
Note : this channel does not support concurrent operations, since underlying CharacterChannel is not synchronous.
Constructor and Description |
---|
TextRecordChannel(CharacterChannel channel,
String recordSeparator,
String fieldSeparator) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the record channel.
|
boolean |
hasNext()
Check whether there are more records or not.
|
String[] |
read()
Read the next readRecord.
|
void |
write(BStringArray fields)
Writes a given record to a file.
|
public TextRecordChannel(CharacterChannel channel, String recordSeparator, String fieldSeparator)
public String[] read() throws BallerinaIOException
Read the next readRecord.
An empty list will be returned if all the records have being processed, all records will be marked as processed if all the content have being retrieved from the provided channel.
BallerinaIOException
public void write(BStringArray fields) throws IOException
fields
- the list of fields composing the record.IOException
- during I/O error.public void close()
public boolean hasNext()
Copyright © 2018 WSO2. All rights reserved.