Class: WritableDataChannel
Represents a WritableDataChannel for writing data.
Constructor
Initializes data channel.
init (WritableByteChannel byteChannel, ByteOrder bOrder)
- byteChannel WritableByteChannel
channel which would represent the source to read/write data
- bOrder ByteOrder "BE"
network byte order
Methods
writeInt16 | Writes a 16 bit integer. |
writeInt32 | Writes a 32 bit integer. |
writeInt64 | Writes a 64 bit integer. |
writeFloat32 | Writes a 32 bit float. |
writeFloat64 | Writes a 64 bit float. |
writeBool | Writes a boolean. |
writeString | Writes a given string value to the respective channel. |
writeVarInt | Writes a variable-length integer. |
close | Closes the data channel. |
writeString
Isolated Function
Writes a given string value to the respective channel.
1io:Error? err = dataChannel.writeString(record);
Parameters
- value string
The value, which should be written
- encoding string
The encoding, which will represent the value string
Return Type
(Error?)()
if the content is written successfully or else an io:Error
if any error occurred