This module is designed to support input and output operations via channels in a canonical way, either in a blocking, or non-blocking manner.
A channel represents an I/O source or sink of some bytes, characters, or records that are opened for reading or writing respectively.
The most primitive channel is the
ByteChannel which reads and writes 8-bit bytes. For an example on the
ByteChannel, see the Byte I/O Example.
CharacterChannel is used to read and write characters. The charset encoding is specified when creating the
CharacterChannel. For an example on the
CharacterChannel, see the Read/Write Files Example.
ReadableCharacterChannel points to a JSON or XML source, it can be read and then written directly into a variable of
the respective type. For examples on reading/writing JSON or XML sources, see the JSON I/O Example and XML I/O Example.
Also, Ballerina supports I/O for delimited records. For an example on reading the records in a text file, see the Record I/O Example.
.CSV file can be read and written directly into a
CSVChannel as shown in this CSV I/O Example.
Ballerina supports performing data i/o operations.
A Person object could be serialized into a file or a network socket as seen in the Data I/O Example.
Record type to hold the details of an error.
ReadableByteChannel represents an input resource (i.
Represents a ReadableCSVChannel which could be used to read records from CSV file.
Represents a channel, which could be used to read characters through a given ReadableByteChannel.
Represents a data channel for reading data.
Represents a channel which will allow to read
Represents a reader which will wrap string content as a channel.
WritableByteChannel represents an output resource (i.
Represents a WritableCSVChannel, which could be used to write records from the CSV file.
Represents a channel which could be used to write characters through a given WritableCharacterChannel.
Represents a WritableDataChannel for writing data.
Represents a channel, which will allow to write records through a given WritableCharacterChannel.
Creates an in-memory channel, which will be a reference stream of bytes.
Retrieves a readable CSV channel from a given file path.
Retrieves a writable CSV channel from a given file path.
Retrieves the input read from the STDIN.
Returns a formatted string using the specified format string and arguments.
Default value is the format specified by the CSVChannel.
Field separator will be "," and the record separator will be a new line.
Field separator will be a tab and the record separator will be a new line.
Comma (,) will be used as the field separator.
Tab (/t) will be use as the field separator.
Colon (:) will be use as the field separator.
This will be used to construct a ConnectionTimedOutError.
This will be used to construct an IO GenericError.
This will be used to construct a AccessDeniedError.
This will be used to construct a FileNotFoundError.
This will be used to construct an EofError.
Represents the record separator of the CSV file.
Represents the colon separator, which should be used to identify colon-separated files.
Represents the minimum number of headers, which will be included in the CSV.
Specifies the bytes to be in the order of most significant byte first.
Specifies the byte order to be the least significant byte first.
Represents IO module related errors.
The format, which will be used to represent the CSV.
Field separators, which are supported by the
This will get returned due to file permission issues.
This will return when connection timed out happen when try to connect to a remote host.
This will get returned if read operations are performed on a channel after it closed.
This will get returned if the file is not available in the given file path.
Represents generic IO error.