final class CharsetEncoder extends AnyVal
An engine that can transform a sequence of sixteen-bit Unicode characters into a sequence of bytes in a specific charset.
Important: an encoder instance is stateful, as it internally tracks the state of the current encoding operation.
- an encoder instance cannot be used concurrently, it can only encode a single sequence of characters at a time
- after an encode operation is completed, the
resetmethod must be used to reset the decoder before using it again on a new sequence of characters
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- CharsetEncoder
- AnyVal
- Any
- Hide All
- Show All
Visibility
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
##(): Int
- Definition Classes
- Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- def averageBytesPerChar: Float
- def charset: Charset
- def encode(in: CharBuffer, out: ByteBuffer, endOfInput: Boolean)(implicit trace: ZTraceElement): UIO[CoderResult]
- def encode(in: CharBuffer)(implicit trace: ZTraceElement): IO[CharacterCodingException, ByteBuffer]
- def flush(out: ByteBuffer)(implicit trace: ZTraceElement): UIO[CoderResult]
-
def
getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val javaEncoder: java.nio.charset.CharsetEncoder
- def malformedInputAction(implicit trace: ZTraceElement): UIO[CodingErrorAction]
- def maxCharsPerByte: Float
- def onMalformedInput(errorAction: CodingErrorAction)(implicit trace: ZTraceElement): UIO[Unit]
- def onUnmappableCharacter(errorAction: CodingErrorAction)(implicit trace: ZTraceElement): UIO[Unit]
- def replaceWith(replacement: Chunk[Byte])(implicit trace: ZTraceElement): UIO[Unit]
- def replacement(implicit trace: ZTraceElement): UIO[Chunk[Byte]]
-
def
reset(implicit trace: ZTraceElement): UIO[Unit]
Resets this decoder, clearing any internal state.
-
def
toString(): String
- Definition Classes
- Any
-
def
transducer(bufSize: Int = 5000)(implicit trace: ZTraceElement): ZPipeline[Any, CharacterCodingException, Char, Byte]
Encodes a stream of characters into bytes according to this character set's encoding.
Encodes a stream of characters into bytes according to this character set's encoding.
Note the returned transducer is tied to this encoder and cannot be used concurrently.
- bufSize
The size of the internal buffer used for encoding. Must be at least 50.
- def unmappableCharacterAction(implicit trace: ZTraceElement): UIO[CodingErrorAction]