newEncoderFeed
Creates a new Encoder.Feed, outputting encoded data to the supplied Encoder.OutFeed.
e.g. (Writing encoded data to a file)
file.outputStream().use { oStream ->
myEncoder.newEncoderFeed { encodedChar ->
oStream.write(encodedChar.code)
}.use { feed ->
"Hello World!".forEach { c ->
feed.consume(c.code.toByte())
}
}
}
Content copied to clipboard