(CharBuffer cb)
| 222 | |
| 223 | // implementation of canEncode |
| 224 | private boolean implCanEncode(CharBuffer cb) { |
| 225 | if (status == FLUSH || status == INIT) { |
| 226 | status = READY; |
| 227 | } |
| 228 | if (status != READY) { |
| 229 | // niochar.0B=Another encoding process is ongoing\! |
| 230 | throw new IllegalStateException(Messages.getString("niochar.0B")); //$NON-NLS-1$ |
| 231 | } |
| 232 | CodingErrorAction malformBak = malformAction; |
| 233 | CodingErrorAction unmapBak = unmapAction; |
| 234 | onMalformedInput(CodingErrorAction.REPORT); |
| 235 | onUnmappableCharacter(CodingErrorAction.REPORT); |
| 236 | boolean result = true; |
| 237 | try { |
| 238 | this.encode(cb); |
| 239 | } catch (CharacterCodingException e) { |
| 240 | result = false; |
| 241 | } |
| 242 | onMalformedInput(malformBak); |
| 243 | onUnmappableCharacter(unmapBak); |
| 244 | reset(); |
| 245 | return result; |
| 246 | } |
| 247 | |
| 248 | /** |
| 249 | * Checks if a given <code>CharSequence</code> can be encoded by this |
no test coverage detected