APIdia Launch Partner
Top Fields Constructors Methods
sun.nio.cs.ext

public abstract Class SimpleEUCEncoder

extends CharsetEncoder
Class Inheritance
Known Direct Subclasses
sun.nio.cs.ext.IBM33722.Encoder, sun.nio.cs.ext.IBM964.Encoder
Imports
java.nio.ByteBuffer, .CharBuffer, java.nio.charset.Charset, .CharsetEncoder, .CoderResult, sun.nio.cs.Surrogate

Field Summary

Modifier and TypeField and Description
protected short[]
protected String
protected String
protected String
protected String
protected int
protected int
private byte[]
private final Surrogate.Parser
protected int

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public boolean
canEncode(char ch)

Overrides java.nio.charset.CharsetEncoder.canEncode.

Returns true if the given character can be converted to the target character encoding.

public byte
encode(char inputChar)

private CoderResult
private CoderResult
protected CoderResult
encodeLoop(CharBuffer src, ByteBuffer dst)

Implements abstract java.nio.charset.CharsetEncoder.encodeLoop.

Encodes one or more characters into one or more bytes.

Inherited from java.nio.charset.CharsetEncoder:
averageBytesPerCharcanEncodecharsetencodeencodeflushimplFlushimplOnMalformedInputimplOnUnmappableCharacterimplReplaceWithimplResetisLegalReplacementmalformedInputActionmaxBytesPerCharonMalformedInputonUnmappableCharacterreplacementreplaceWithresetunmappableCharacterAction

Field Detail

index1back to summary
protected short[] index1
index2back to summary
protected String index2
index2aback to summary
protected String index2a
index2bback to summary
protected String index2b
index2cback to summary
protected String index2c
mask1back to summary
protected int mask1
mask2back to summary
protected int mask2
outputByteback to summary
private byte[] outputByte
sgpback to summary
private final Surrogate.Parser sgp
shiftback to summary
protected int shift

Constructor Detail

SimpleEUCEncoderback to summary
protected SimpleEUCEncoder(Charset cs)

Method Detail

canEncodeback to summary
public boolean canEncode(char ch)

Overrides java.nio.charset.CharsetEncoder.canEncode.

Returns true if the given character can be converted to the target character encoding.

encodeback to summary
public byte encode(char inputChar)
encodeArrayLoopback to summary
private CoderResult encodeArrayLoop(CharBuffer src, ByteBuffer dst)
encodeBufferLoopback to summary
private CoderResult encodeBufferLoop(CharBuffer src, ByteBuffer dst)
encodeLoopback to summary
protected CoderResult encodeLoop(CharBuffer src, ByteBuffer dst)

Implements abstract java.nio.charset.CharsetEncoder.encodeLoop.

Doc from java.nio.charset.CharsetEncoder.encodeLoop.

Encodes one or more characters into one or more bytes.

This method encapsulates the basic encoding loop, encoding as many characters as possible until it either runs out of input, runs out of room in the output buffer, or encounters an encoding error. This method is invoked by the encode method, which handles result interpretation and error recovery.

The buffers are read from, and written to, starting at their current positions. At most in.remaining() characters will be read, and at most out.remaining() bytes will be written. The buffers' positions will be advanced to reflect the characters read and the bytes 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 encode method. Most implementations of this method will handle encoding errors by returning an appropriate result object for interpretation by the encode 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.