(CharBuffer chars)
| 244 | } |
| 245 | |
| 246 | private void convert(CharBuffer chars) throws IOException { |
| 247 | CoderResult result = encoder.encode(chars, bytes, true); |
| 248 | encoderFlush = true; |
| 249 | while (true) { |
| 250 | if (result.isError()) { |
| 251 | throw new IOException(result.toString()); |
| 252 | } else if (result.isOverflow()) { |
| 253 | // flush the output buffer |
| 254 | flush(); |
| 255 | result = encoder.encode(chars, bytes, true); |
| 256 | continue; |
| 257 | } |
| 258 | break; |
| 259 | } |
| 260 | } |
| 261 | |
| 262 | /** |
| 263 | * Writes the character {@code oneChar} to this writer. The lowest two bytes |