The following diagram depicts the overview architecture of the I/O package.
The I/O package allows you to read from the console or a file. Further, the file I/O operations can be categorized based on serialization and deserialization types such as:
- Bytes I/O
- Strings I/O
- CSV I/O
- JSON I/O
- XML I/O
The console I/O APIs, which help the user to read from the console as well as write to the console are as follows.
The bytes I/O APIs provide the reading and writing APIs in both streaming and non-streaming ways. Those APIs are,
To learn how to use bytes read and write APIs, see the Read/Write Bytes example.
The strings I/O APIs provide the reading and writing APIs in 3 different ways:
- Read the whole file content as a string and write a given string to a file
- Read the whole file content as a set of lines and write a given set of lines to a file
- Read the whole file content as a stream of lines and write a given stream of lines to a file
The strings I/O APIs are as follows:
To learn how to use strings read and write APIs, see the Read/Write Strings example.
The CSV I/O APIs provide the reading and writing APIs in both streaming and non-streaming ways. Those APIs are,
To learn how to use CSV read and write APIs, see the Read/Write CSV example.
The JSON I/O APIs provide the reading and writing APIs for JSON content. Those APIs are,
To learn how to use JSON read and write APIs, see the Read/Write JSON example.
The XML I/O APIs provide the reading and writing APIs for XML content. Those APIs are,
To learn how to use XML read and write APIs, see the Read/Write XML example.
Creates an in-memory channel, which will be a reference stream of bytes.
Read the entire file content as a stream of blocks.
Read the entire file content as a byte array.
Read file content as a CSV.
Read file content as a CSV.
Reads file content as a JSON.
Reads the entire file content as a list of lines.
Reads file content as a stream of lines.
Reads the entire file content as a
Reads file content as an XML.
Write a byte stream to a file.
Write a set of bytes to a file.
Write CSV content to a file.
Write CSV record stream to a file.
Write a JSON to a file.
Write an array of lines to a file.
Write stream of lines to a file.
Write a string content to a file.
Write XML content to a file.
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.
ReadableByteChannel represents an input resource (i.e file).
Represents a channel, which could be used to read characters through a given ReadableByteChannel.
Represents a ReadableCSVChannel which could be used to read records from CSV file.
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.e file) which could be used to sink bytes
A file path can be used to obtain a
Represents a channel which could be used to write characters through a given WritableCharacterChannel.
Represents a WritableCSVChannel, which could be used to write records from the CSV file.
Represents a WritableDataChannel for writing data.
Represents a channel, which will allow to write records through a given WritableCharacterChannel.
Represents raw templates.
Represents the XML DOCTYPE entity.
The writing options of an XML.
Specifies the bytes to be in the order of most significant byte first.
Colon (:) will be use as the field separator.
Comma (,) will be used as the field separator.
Field separator will be "," and the record separator will be a new line.
Represents the record separator of the CSV file.
Default value is the format specified by the CSVChannel.
Default encoding for the abstract read/write APIs.
Represents the colon separator, which should be used to identify colon-separated files.
Specifies the byte order to be the least significant byte first.
Represents the minimum number of headers, which will be included in the CSV.
New line character.
Tab (/t) will be use as the field separator.
Field separator will be a tab and the record separator will be a new line.
Represents a file opening options for writing.
Represents the XML entity type that needs to be written.
Represents network byte order.
The format, which will be used to represent the CSV.
Define all the printable types.
Field separators, which are supported by the
Represents IO module related errors.