Udostępnij za pośrednictwem


CharsetDecoder.DecodeLoop(ByteBuffer, CharBuffer) Method

Definition

Decodes one or more bytes into one or more characters.

[Android.Runtime.Register("decodeLoop", "(Ljava/nio/ByteBuffer;Ljava/nio/CharBuffer;)Ljava/nio/charset/CoderResult;", "GetDecodeLoop_Ljava_nio_ByteBuffer_Ljava_nio_CharBuffer_Handler")]
protected abstract Java.Nio.Charset.CoderResult? DecodeLoop (Java.Nio.ByteBuffer? in, Java.Nio.CharBuffer? out);
[<Android.Runtime.Register("decodeLoop", "(Ljava/nio/ByteBuffer;Ljava/nio/CharBuffer;)Ljava/nio/charset/CoderResult;", "GetDecodeLoop_Ljava_nio_ByteBuffer_Ljava_nio_CharBuffer_Handler")>]
abstract member DecodeLoop : Java.Nio.ByteBuffer * Java.Nio.CharBuffer -> Java.Nio.Charset.CoderResult

Parameters

in
ByteBuffer

The input byte buffer

out
CharBuffer

The output character buffer

Returns

A coder-result object describing the reason for termination

Attributes

Remarks

Decodes one or more bytes into one or more characters.

This method encapsulates the basic decoding loop, decoding as many bytes as possible until it either runs out of input, runs out of room in the output buffer, or encounters a decoding error. This method is invoked by the #decode decode method, which handles result interpretation and error recovery.

The buffers are read from, and written to, starting at their current positions. At most Buffer#remaining in.remaining() bytes will be read, and at most Buffer#remaining out.remaining() characters will be written. The buffers' positions will be advanced to reflect the bytes read and the characters written, but their marks and limits will not be modified.

This method returns a CoderResult object to describe its reason for termination, in the same manner as the #decode decode method. Most implementations of this method will handle decoding errors by returning an appropriate result object for interpretation by the #decode decode method. An optimized implementation may instead examine the relevant error action and implement that action itself.

An implementation of this method may perform arbitrary lookahead by returning CoderResult#UNDERFLOW until it receives sufficient input.

Java documentation for java.nio.charset.CharsetDecoder.decodeLoop(java.nio.ByteBuffer, java.nio.CharBuffer).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to