Java Doc for Charset-X-Coder.java in  » 6.0-JDK-Core » io-nio » java » nio » charset » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » io nio » java.nio.charset 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.nio.charset.Charset$Coder$

Charset$Coder$
abstract public class Charset$Coder$ (Code)
An engine that can transform a sequence of $itypesPhrase$ into a sequence of $otypesPhrase$.

The input $itype$ sequence is provided in a $itype$ buffer or a series of such buffers. The output $otype$ sequence is written to a $otype$ buffer or a series of such buffers. $A$ $coder$ should always be used by making the following sequence of method invocations, hereinafter referred to as $a$ $coding$ operation:

  1. Reset the $coder$ via the Charset$Coder$.reset reset method, unless it has not been used before;

  2. Invoke the Charset$Coder$.$code$ $code$ method zero or more times, as long as additional input may be available, passing false for the endOfInput argument and filling the input buffer and flushing the output buffer between invocations;

  3. Invoke the Charset$Coder$.$code$ $code$ method one final time, passing true for the endOfInput argument; and then

  4. Invoke the Charset$Coder$.flush flush method so that the $coder$ can flush any internal state to the output buffer.

Each invocation of the Charset$Coder$.$code$ $code$ method will $code$ as many $itype$s as possible from the input buffer, writing the resulting $otype$s to the output buffer. The Charset$Coder$.$code$ $code$ method returns when more input is required, when there is not enough room in the output buffer, or when $a$ $coding$ error has occurred. In each case a
CoderResult object is returned to describe the reason for termination. An invoker can examine this object and fill the input buffer, flush the output buffer, or attempt to recover from $a$ $coding$ error, as appropriate, and try again.

There are two general types of $coding$ errors. If the input $itype$ sequence is $notLegal$ then the input is considered malformed. If the input $itype$ sequence is legal but cannot be mapped to a valid $outSequence$ then an unmappable character has been encountered.

How $a$ $coding$ error is handled depends upon the action requested for that type of error, which is described by an instance of the CodingErrorAction class. The possible error actions are to CodingErrorAction.IGNORE ignore the erroneous input, CodingErrorAction.REPORT report the error to the invoker via the returned CoderResult object, or CodingErrorAction.REPLACEreplace the erroneous input with the current value of the replacement $replTypeName$. The replacement #if[encoder] is initially set to the $coder$'s default replacement, which often (but not always) has the initial value $defaultReplName$; #end[encoder] #if[decoder] has the initial value $defaultReplName$; #end[decoder] its value may be changed via the Charset$Coder$.replaceWith($replFQType$)replaceWith method.

The default action for malformed-input and unmappable-character errors is to CodingErrorAction.REPORT report them. The malformed-input error action may be changed via the Charset$Coder$.onMalformedInput(CodingErrorAction) onMalformedInput method; the unmappable-character action may be changed via the Charset$Coder$.onUnmappableCharacter(CodingErrorAction) onUnmappableCharacter method.

This class is designed to handle many of the details of the $coding$ process, including the implementation of error actions. $A$ $coder$ for a specific charset, which is a concrete subclass of this class, need only implement the abstract Charset$Coder$.$code$Loop $code$Loop method, which encapsulates the basic $coding$ loop. A subclass that maintains internal state should, additionally, override the Charset$Coder$.implFlush implFlush and Charset$Coder$.implReset implReset methods.

Instances of this class are not safe for use by multiple concurrent threads.


version:
   1.52, 07/05/05
author:
   Mark Reinhold
author:
   JSR-51 Expert Group
since:
   1.4
See Also:   ByteBuffer
See Also:   CharBuffer
See Also:   Charset
See Also:   Charset$OtherCoder$



Constructor Summary
 Charset$Coder$(Charset cs, float average$ItypesPerOtype$, float max$ItypesPerOtype$, $replType$ replacement)
    
protected  Charset$Coder$(Charset cs, float average$ItypesPerOtype$, float max$ItypesPerOtype$)
     Initializes a new $coder$.

Method Summary
final public  CoderResult$code$($Itype$Buffer in, $Otype$Buffer out, boolean endOfInput)
     $Code$s as many $itype$s as possible from the given input buffer, writing the results to the given output buffer.

The buffers are read from, and written to, starting at their current positions.

final public  $Otype$Buffer$code$($Itype$Buffer in)
     Convenience method that $code$s the remaining content of a single input $itype$ buffer into a newly-allocated $otype$ buffer.

This method implements an entire $coding$ operation; that is, it resets this $coder$, then it $code$s the $itype$s in the given $itype$ buffer, and finally it flushes this $coder$.

abstract protected  CoderResult$code$Loop($Itype$Buffer in, $Otype$Buffer out)
     $Code$s one or more $itype$s into one or more $otype$s.

This method encapsulates the basic $coding$ loop, $coding$ as many $itype$s as possible until it either runs out of input, runs out of room in the output buffer, or encounters $a$ $coding$ error.

final public  floataverage$ItypesPerOtype$()
     Returns the average number of $otype$s that will be produced for each $itype$ of input.
public  booleancanEncode(char c)
     Tells whether or not this encoder can encode the given character.

This method returns false if the given character is a surrogate character; such characters can be interpreted only when they are members of a pair consisting of a high surrogate followed by a low surrogate.

public  booleancanEncode(CharSequence cs)
     Tells whether or not this encoder can encode the given character sequence.

If this method returns false for a particular character sequence then more information about why the sequence cannot be encoded may be obtained by performing a full encoding operation.

This method may modify this encoder's state; it should therefore not be invoked if an encoding operation is already in progress.

The default implementation of this method is not very efficient; it should generally be overridden to improve performance.

final public  Charsetcharset()
     Returns the charset that created this $coder$.
public  CharsetdetectedCharset()
     Retrieves the charset that was detected by this decoder  (optional operation).

If this decoder implements an auto-detecting charset then this method returns the actual charset once it has been detected.

final public  CoderResultflush($Otype$Buffer out)
     Flushes this $coder$.

Some $coder$s maintain internal state and may need to write some final $otype$s to the output buffer once the overall input sequence has been read.

Any additional output is written to the output buffer beginning at its current position.

protected  CoderResultimplFlush($Otype$Buffer out)
     Flushes this $coder$.

The default implementation of this method does nothing, and always returns CoderResult.UNDERFLOW .

protected  voidimplOnMalformedInput(CodingErrorAction newAction)
     Reports a change to this $coder$'s malformed-input action.

The default implementation of this method does nothing.

protected  voidimplOnUnmappableCharacter(CodingErrorAction newAction)
     Reports a change to this $coder$'s unmappable-character action.

The default implementation of this method does nothing.

protected  voidimplReplaceWith($replType$ newReplacement)
     Reports a change to this $coder$'s replacement value.

The default implementation of this method does nothing.

protected  voidimplReset()
     Resets this $coder$, clearing any charset-specific internal state.

The default implementation of this method does nothing.

public  booleanisAutoDetecting()
     Tells whether or not this decoder implements an auto-detecting charset.

The default implementation of this method always returns false; it should be overridden by auto-detecting decoders to return true.

public  booleanisCharsetDetected()
     Tells whether or not this decoder has yet detected a charset  (optional operation).

If this decoder implements an auto-detecting charset then at a single point during a decoding operation this method may start returning true to indicate that a specific charset has been detected in the input byte sequence.

public  booleanisLegalReplacement(byte[] repl)
     Tells whether or not the given byte array is a legal replacement value for this encoder.

A replacement is legal if, and only if, it is a legal sequence of bytes in this encoder's charset; that is, it must be possible to decode the replacement into one or more sixteen-bit Unicode characters.

The default implementation of this method is not very efficient; it should generally be overridden to improve performance.

public  CodingErrorActionmalformedInputAction()
     Returns this $coder$'s current action for malformed-input errors.
final public  floatmax$ItypesPerOtype$()
     Returns the maximum number of $otype$s that will be produced for each $itype$ of input.
final public  Charset$Coder$onMalformedInput(CodingErrorAction newAction)
     Changes this $coder$'s action for malformed-input errors.
final public  Charset$Coder$onUnmappableCharacter(CodingErrorAction newAction)
     Changes this $coder$'s action for unmappable-character errors.

This method invokes the Charset$Coder$.implOnUnmappableCharacterimplOnUnmappableCharacter method, passing the new action.

final public  Charset$Coder$replaceWith($replType$ newReplacement)
     Changes this $coder$'s replacement value.

This method invokes the Charset$Coder$.implReplaceWith implReplaceWith method, passing the new replacement, after checking that the new replacement is acceptable.

final public  $replType$replacement()
     Returns this $coder$'s replacement value.
final public  Charset$Coder$reset()
     Resets this $coder$, clearing any internal state.

This method resets charset-independent state and also invokes the Charset$Coder$.implReset() implReset method in order to perform any charset-specific reset actions.

public  CodingErrorActionunmappableCharacterAction()
     Returns this $coder$'s current action for unmappable-character errors.


Constructor Detail
Charset$Coder$
Charset$Coder$(Charset cs, float average$ItypesPerOtype$, float max$ItypesPerOtype$, $replType$ replacement)(Code)



Charset$Coder$
protected Charset$Coder$(Charset cs, float average$ItypesPerOtype$, float max$ItypesPerOtype$)(Code)
Initializes a new $coder$. The new $coder$ will have the given $otypes-per-itype$ values and its replacement will be the $replTypeName$ $defaultReplName$.


Parameters:
  average$ItypesPerOtype$ - A positive float value indicating the expected number of$otype$s that will be produced for each input $itype$
Parameters:
  max$ItypesPerOtype$ - A positive float value indicating the maximum number of$otype$s that will be produced for each input $itype$
throws:
  IllegalArgumentException - If the preconditions on the parameters do not hold




Method Detail
$code$
final public CoderResult $code$($Itype$Buffer in, $Otype$Buffer out, boolean endOfInput)(Code)
$Code$s as many $itype$s as possible from the given input buffer, writing the results to the given output buffer.

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

In addition to reading $itype$s from the input buffer and writing $otype$s to the output buffer, this method returns a CoderResult object to describe its reason for termination:

  • CoderResult.UNDERFLOW indicates that as much of the input buffer as possible has been $code$d. If there is no further input then the invoker can proceed to the next step of the $coding$ operation. Otherwise this method should be invoked again with further input.

  • CoderResult.OVERFLOW indicates that there is insufficient space in the output buffer to $code$ any more $itype$s. This method should be invoked again with an output buffer that has more $otype$s. This is typically done by draining any $code$d $otype$s from the output buffer.

  • A CoderResult.malformedForLengthmalformed-input result indicates that a malformed-input error has been detected. The malformed $itype$s begin at the input buffer's (possibly incremented) position; the number of malformed $itype$s may be determined by invoking the result object's CoderResult.length length method. This case applies only if the Charset$Coder$.onMalformedInput malformed action of this $coder$ is CodingErrorAction.REPORT ; otherwise the malformed input will be ignored or replaced, as requested.

  • An CoderResult.unmappableForLengthunmappable-character result indicates that an unmappable-character error has been detected. The $itype$s that $code$ the unmappable character begin at the input buffer's (possibly incremented) position; the number of such $itype$s may be determined by invoking the result object's CoderResult.length length method. This case applies only if the Charset$Coder$.onUnmappableCharacterunmappable action of this $coder$ is CodingErrorAction.REPORT ; otherwise the unmappable character will be ignored or replaced, as requested.

In any case, if this method is to be reinvoked in the same $coding$ operation then care should be taken to preserve any $itype$s remaining in the input buffer so that they are available to the next invocation.

The endOfInput parameter advises this method as to whether the invoker can provide further input beyond that contained in the given input buffer. If there is a possibility of providing additional input then the invoker should pass false for this parameter; if there is no possibility of providing further input then the invoker should pass true. It is not erroneous, and in fact it is quite common, to pass false in one invocation and later discover that no further input was actually available. It is critical, however, that the final invocation of this method in a sequence of invocations always pass true so that any remaining un$code$d input will be treated as being malformed.

This method works by invoking the Charset$Coder$.$code$Loop $code$Loop method, interpreting its results, handling error conditions, and reinvoking it as necessary.


Parameters:
  in - The input $itype$ buffer
Parameters:
  out - The output $otype$ buffer
Parameters:
  endOfInput - true if, and only if, the invoker can provide noadditional input $itype$s beyond those in the given buffer A coder-result object describing the reason for termination
throws:
  IllegalStateException - If $a$ $coding$ operation is already in progress and the previousstep was an invocation neither of the Charset$Coder$.reset resetmethod, nor of this method with a value of false forthe endOfInput parameter, nor of this method with avalue of true for the endOfInput parameterbut a return value indicating an incomplete $coding$ operation
throws:
  CoderMalfunctionError - If an invocation of the $code$Loop method threwan unexpected exception



$code$
final public $Otype$Buffer $code$($Itype$Buffer in) throws CharacterCodingException(Code)
Convenience method that $code$s the remaining content of a single input $itype$ buffer into a newly-allocated $otype$ buffer.

This method implements an entire $coding$ operation; that is, it resets this $coder$, then it $code$s the $itype$s in the given $itype$ buffer, and finally it flushes this $coder$. This method should therefore not be invoked if $a$ $coding$ operation is already in progress.


Parameters:
  in - The input $itype$ buffer A newly-allocated $otype$ buffer containing the result of the$coding$ operation. The buffer's position will be zero and itslimit will follow the last $otype$ written.
throws:
  IllegalStateException - If $a$ $coding$ operation is already in progress
throws:
  MalformedInputException - If the $itype$ sequence starting at the input buffer's currentposition is $notLegal$ and the current malformed-input actionis CodingErrorAction.REPORT
throws:
  UnmappableCharacterException - If the $itype$ sequence starting at the input buffer's currentposition cannot be mapped to an equivalent $otype$ sequence andthe current unmappable-character action is CodingErrorAction.REPORT



$code$Loop
abstract protected CoderResult $code$Loop($Itype$Buffer in, $Otype$Buffer out)(Code)
$Code$s one or more $itype$s into one or more $otype$s.

This method encapsulates the basic $coding$ loop, $coding$ as many $itype$s as possible until it either runs out of input, runs out of room in the output buffer, or encounters $a$ $coding$ error. This method is invoked by the Charset$Coder$.$code$ $code$ 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() $itype$s will be read, and at most Buffer.remaining out.remaining() $otype$s will be written. The buffers' positions will be advanced to reflect the $itype$s read and the $otype$s 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 Charset$Coder$.$code$ $code$ method. Most implementations of this method will handle $coding$ errors by returning an appropriate result object for interpretation by the Charset$Coder$.$code$ $code$ 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.


Parameters:
  in - The input $itype$ buffer
Parameters:
  out - The output $otype$ buffer A coder-result object describing the reason for termination



average$ItypesPerOtype$
final public float average$ItypesPerOtype$()(Code)
Returns the average number of $otype$s that will be produced for each $itype$ of input. This heuristic value may be used to estimate the size of the output buffer required for a given input sequence.

The average number of $otype$s producedper $itype$ of input



canEncode
public boolean canEncode(char c)(Code)
Tells whether or not this encoder can encode the given character.

This method returns false if the given character is a surrogate character; such characters can be interpreted only when they are members of a pair consisting of a high surrogate followed by a low surrogate. The Charset$Coder$.canEncode(java.lang.CharSequence)canEncode(CharSequence) method may be used to test whether or not a character sequence can be encoded.

This method may modify this encoder's state; it should therefore not be invoked if an encoding operation is already in progress.

The default implementation of this method is not very efficient; it should generally be overridden to improve performance.

true if, and only if, this encoder can encodethe given character
throws:
  IllegalStateException - If $a$ $coding$ operation is already in progress



canEncode
public boolean canEncode(CharSequence cs)(Code)
Tells whether or not this encoder can encode the given character sequence.

If this method returns false for a particular character sequence then more information about why the sequence cannot be encoded may be obtained by performing a full encoding operation.

This method may modify this encoder's state; it should therefore not be invoked if an encoding operation is already in progress.

The default implementation of this method is not very efficient; it should generally be overridden to improve performance.

true if, and only if, this encoder can encodethe given character without throwing any exceptions and withoutperforming any replacements
throws:
  IllegalStateException - If $a$ $coding$ operation is already in progress



charset
final public Charset charset()(Code)
Returns the charset that created this $coder$.

This $coder$'s charset



detectedCharset
public Charset detectedCharset()(Code)
Retrieves the charset that was detected by this decoder  (optional operation).

If this decoder implements an auto-detecting charset then this method returns the actual charset once it has been detected. After that point, this method returns the same value for the duration of the current decoding operation. If not enough input bytes have yet been read to determine the actual charset then this method throws an IllegalStateException .

The default implementation of this method always throws an UnsupportedOperationException ; it should be overridden by auto-detecting decoders to return the appropriate value.

The charset detected by this auto-detecting decoder,or null if the charset has not yet been determined
throws:
  IllegalStateException - If insufficient bytes have been read to determine a charset
throws:
  UnsupportedOperationException - If this decoder does not implement an auto-detecting charset



flush
final public CoderResult flush($Otype$Buffer out)(Code)
Flushes this $coder$.

Some $coder$s maintain internal state and may need to write some final $otype$s to the output buffer once the overall input sequence has been read.

Any additional output is written to the output buffer beginning at its current position. At most Buffer.remaining out.remaining() $otype$s will be written. The buffer's position will be advanced appropriately, but its mark and limit will not be modified.

If this method completes successfully then it returns CoderResult.UNDERFLOW . If there is insufficient room in the output buffer then it returns CoderResult.OVERFLOW . If this happens then this method must be invoked again, with an output buffer that has more room, in order to complete the current $coding$ operation.

If this $coder$ has already been flushed then invoking this method has no effect.

This method invokes the Charset$Coder$.implFlush implFlush method to perform the actual flushing operation.


Parameters:
  out - The output $otype$ buffer A coder-result object, either CoderResult.UNDERFLOW orCoderResult.OVERFLOW
throws:
  IllegalStateException - If the previous step of the current $coding$ operation was aninvocation neither of the Charset$Coder$.flush flush method nor ofthe three-argument Charset$Coder$.$code$($Itype$Buffer,$Otype$Buffer,boolean) $code$ methodwith a value of true for the endOfInputparameter



implFlush
protected CoderResult implFlush($Otype$Buffer out)(Code)
Flushes this $coder$.

The default implementation of this method does nothing, and always returns CoderResult.UNDERFLOW . This method should be overridden by $coder$s that may need to write final $otype$s to the output buffer once the entire input sequence has been read.


Parameters:
  out - The output $otype$ buffer A coder-result object, either CoderResult.UNDERFLOW orCoderResult.OVERFLOW



implOnMalformedInput
protected void implOnMalformedInput(CodingErrorAction newAction)(Code)
Reports a change to this $coder$'s malformed-input action.

The default implementation of this method does nothing. This method should be overridden by $coder$s that require notification of changes to the malformed-input action.




implOnUnmappableCharacter
protected void implOnUnmappableCharacter(CodingErrorAction newAction)(Code)
Reports a change to this $coder$'s unmappable-character action.

The default implementation of this method does nothing. This method should be overridden by $coder$s that require notification of changes to the unmappable-character action.




implReplaceWith
protected void implReplaceWith($replType$ newReplacement)(Code)
Reports a change to this $coder$'s replacement value.

The default implementation of this method does nothing. This method should be overridden by $coder$s that require notification of changes to the replacement.


Parameters:
  newReplacement -



implReset
protected void implReset()(Code)
Resets this $coder$, clearing any charset-specific internal state.

The default implementation of this method does nothing. This method should be overridden by $coder$s that maintain internal state.




isAutoDetecting
public boolean isAutoDetecting()(Code)
Tells whether or not this decoder implements an auto-detecting charset.

The default implementation of this method always returns false; it should be overridden by auto-detecting decoders to return true.

true if, and only if, this decoder implements anauto-detecting charset



isCharsetDetected
public boolean isCharsetDetected()(Code)
Tells whether or not this decoder has yet detected a charset  (optional operation).

If this decoder implements an auto-detecting charset then at a single point during a decoding operation this method may start returning true to indicate that a specific charset has been detected in the input byte sequence. Once this occurs, the Charset$Coder$.detectedCharsetdetectedCharset method may be invoked to retrieve the detected charset.

That this method returns false does not imply that no bytes have yet been decoded. Some auto-detecting decoders are capable of decoding some, or even all, of an input byte sequence without fixing on a particular charset.

The default implementation of this method always throws an UnsupportedOperationException ; it should be overridden by auto-detecting decoders to return true once the input charset has been determined.

true if, and only if, this decoder has detected aspecific charset
throws:
  UnsupportedOperationException - If this decoder does not implement an auto-detecting charset



isLegalReplacement
public boolean isLegalReplacement(byte[] repl)(Code)
Tells whether or not the given byte array is a legal replacement value for this encoder.

A replacement is legal if, and only if, it is a legal sequence of bytes in this encoder's charset; that is, it must be possible to decode the replacement into one or more sixteen-bit Unicode characters.

The default implementation of this method is not very efficient; it should generally be overridden to improve performance.


Parameters:
  repl - The byte array to be tested true if, and only if, the given byte arrayis a legal replacement value for this encoder



malformedInputAction
public CodingErrorAction malformedInputAction()(Code)
Returns this $coder$'s current action for malformed-input errors.

The current malformed-input action, which is never null



max$ItypesPerOtype$
final public float max$ItypesPerOtype$()(Code)
Returns the maximum number of $otype$s that will be produced for each $itype$ of input. This value may be used to compute the worst-case size of the output buffer required for a given input sequence.

The maximum number of $otype$s that will be produced per$itype$ of input



onMalformedInput
final public Charset$Coder$ onMalformedInput(CodingErrorAction newAction)(Code)
Changes this $coder$'s action for malformed-input errors.

This method invokes the Charset$Coder$.implOnMalformedInputimplOnMalformedInput method, passing the new action.


Parameters:
  newAction - The new action; must not be null This $coder$
throws:
  IllegalArgumentException - If the precondition on the parameter does not hold



onUnmappableCharacter
final public Charset$Coder$ onUnmappableCharacter(CodingErrorAction newAction)(Code)
Changes this $coder$'s action for unmappable-character errors.

This method invokes the Charset$Coder$.implOnUnmappableCharacterimplOnUnmappableCharacter method, passing the new action.


Parameters:
  newAction - The new action; must not be null This $coder$
throws:
  IllegalArgumentException - If the precondition on the parameter does not hold



replaceWith
final public Charset$Coder$ replaceWith($replType$ newReplacement)(Code)
Changes this $coder$'s replacement value.

This method invokes the Charset$Coder$.implReplaceWith implReplaceWith method, passing the new replacement, after checking that the new replacement is acceptable.


Parameters:
  newReplacement - #if[decoder]The new replacement; must not be nulland must have non-zero length#end[decoder]#if[encoder]The new replacement; must not be null, must havenon-zero length, must not be longer than the value returned bythe Charset$Coder$.max$ItypesPerOtype$() max$ItypesPerOtype$ method, andmust be Charset$Coder$.isLegalReplacement legal#end[encoder] This $coder$
throws:
  IllegalArgumentException - If the preconditions on the parameter do not hold



replacement
final public $replType$ replacement()(Code)
Returns this $coder$'s replacement value.

This $coder$'s current replacement,which is never null and is never empty



reset
final public Charset$Coder$ reset()(Code)
Resets this $coder$, clearing any internal state.

This method resets charset-independent state and also invokes the Charset$Coder$.implReset() implReset method in order to perform any charset-specific reset actions.

This $coder$



unmappableCharacterAction
public CodingErrorAction unmappableCharacterAction()(Code)
Returns this $coder$'s current action for unmappable-character errors.

The current unmappable-character action, which is nevernull



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.