This module provides file read/write APIs and console print/read APIs. The file APIs allow read and write operations on different kinds of file types such as bytes, text, CSV, JSON, and XML. Further, these file APIs can be categorized as streaming and non-streaming APIs.
The file I/O operations can be categorized further based on the 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 you 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,
The strings I/O APIs provide the reading and writing APIs in 3 different ways:
- Read the complete file content as a string and write a given string to a file
- Read the complete file content as a set of lines and write a given set of lines to a file
- Read the complete 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:
The CSV I/O APIs provide the reading and writing APIs in both streaming and non-streaming ways. Those APIs are:
The JSON I/O APIs provide the reading and writing APIs for JSON content. Those APIs are:
The XML I/O APIs provide the reading and writing APIs for XML content. Those APIs are:
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.
The iterator for the stream returned in
ReadableByteChannel represents an input resource (i.e file), which could be used to source bytes.
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 an
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.
The 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.
Represents the standard error stream.
Represents the standard output stream.
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.
The read-only byte array that is used to read the byte content from the streams.
Represents network byte order.
Defines the output streaming types.
The format, which will be used to represent the CSV.
Defines all the printable types.
Field separators, which are supported by the
This will get returned due to file permission issues.
This will get returned if there is an invalid configuration.
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.
Represents IO module related errors.
This will get returned if the file is not available in the given file path.
Represents generic IO error.
This will get returned when there is an mismatch of given type and the expected type.