Writes count characters starting at offset in buf to this writer. The characters are immediately converted to bytes by the character converter and stored in a local buffer. If the buffer gets full as a result of the conversion, this writer is flushed. @param buf t
(char[] buf, int offset, int count)
| 232 | * occurs. |
| 233 | */ |
| 234 | @Override |
| 235 | public void write(char[] buf, int offset, int count) throws IOException { |
| 236 | synchronized (lock) { |
| 237 | checkStatus(); |
| 238 | if (offset < 0 || offset > buf.length - count || count < 0) { |
| 239 | throw new IndexOutOfBoundsException(); |
| 240 | } |
| 241 | CharBuffer chars = CharBuffer.wrap(buf, offset, count); |
| 242 | convert(chars); |
| 243 | } |
| 244 | } |
| 245 | |
| 246 | private void convert(CharBuffer chars) throws IOException { |
| 247 | CoderResult result = encoder.encode(chars, bytes, true); |
nothing calls this directly
no test coverage detected