/** * Writes a single character. This method supports 16-bits * character surrogates. * * @param c <code>char</code> the character to be written (possibly * a surrogate). * @throws IOException if an I/O error occurs. */ public void write(char c) throws IOException { if ((c < 0xd800) || (c > 0xdfff)) { write((int) c); } else if (c < 0xdc00) { // High surrogate. _highSurrogate = c; } else { // Low surrogate. int code = ((_highSurrogate - 0xd800) << 10) + (c - 0xdc00) + 0x10000; write(code); } }
/** * Writes the specified character sequence. * * @param csq the character sequence. * @throws IOException if an I/O error occurs */ public void write(CharSequence csq) throws IOException { final int length = csq.length(); for (int i = 0; i < length; ) { char c = csq.charAt(i++); if (c < 0x80) { _bytes[_index] = (byte) c; if (++_index >= _bytes.length) { flushBuffer(); } } else { write(c); } } }
/** * Writes a portion of a string. * * @param str a String. * @param off the offset from which to start writing characters. * @param len the number of characters to write. * @throws IOException if an I/O error occurs */ @Override public void write(String str, int off, int len) throws IOException { final int off_plus_len = off + len; for (int i = off; i < off_plus_len; ) { char c = str.charAt(i++); if (c < 0x80) { _bytes[_index] = (byte) c; if (++_index >= _bytes.length) { flushBuffer(); } } else { write(c); } } }
/** * Writes a portion of an array of characters. * * @param cbuf the array of characters. * @param off the offset from which to start writing characters. * @param len the number of characters to write. * @throws IOException if an I/O error occurs. */ @Override public void write(char cbuf[], int off, int len) throws IOException { final int off_plus_len = off + len; for (int i = off; i < off_plus_len; ) { char c = cbuf[i++]; if (c < 0x80) { _bytes[_index] = (byte) c; if (++_index >= _bytes.length) { flushBuffer(); } } else { write(c); } } }
/** * Writes a single character. This method supports 16-bits * character surrogates. * * @param c <code>char</code> the character to be written (possibly * a surrogate). * @throws IOException if an I/O error occurs. */ public void write(char c) throws IOException { if ((c < 0xd800) || (c > 0xdfff)) { write((int) c); } else if (c < 0xdc00) { // High surrogate. _highSurrogate = c; } else { // Low surrogate. int code = ((_highSurrogate - 0xd800) << 10) + (c - 0xdc00) + 0x10000; write(code); } }
/** * Writes a single character. This method supports 16-bits * character surrogates. * * @param c <code>char</code> the character to be written (possibly * a surrogate). * @throws IOException if an I/O error occurs. */ public void write(char c) throws IOException { if ((c < 0xd800) || (c > 0xdfff)) { write((int) c); } else if (c < 0xdc00) { // High surrogate. _highSurrogate = c; } else { // Low surrogate. int code = ((_highSurrogate - 0xd800) << 10) + (c - 0xdc00) + 0x10000; write(code); } }
/** * Writes a single character. This method supports 16-bits * character surrogates. * * @param c <code>char</code> the character to be written (possibly * a surrogate). * @throws IOException if an I/O error occurs. */ public void write(char c) throws IOException { if ((c < 0xd800) || (c > 0xdfff)) { write((int) c); } else if (c < 0xdc00) { // High surrogate. _highSurrogate = c; } else { // Low surrogate. int code = ((_highSurrogate - 0xd800) << 10) + (c - 0xdc00) + 0x10000; write(code); } }
/** * Writes a single character. This method supports 16-bits * character surrogates. * * @param c <code>char</code> the character to be written (possibly * a surrogate). * @throws IOException if an I/O error occurs. */ public void write(char c) throws IOException { if ((c < 0xd800) || (c > 0xdfff)) { write((int) c); } else if (c < 0xdc00) { // High surrogate. _highSurrogate = c; } else { // Low surrogate. int code = ((_highSurrogate - 0xd800) << 10) + (c - 0xdc00) + 0x10000; write(code); } }
/** * Writes the specified character sequence. * * @param csq the character sequence. * @throws IOException if an I/O error occurs */ public void write(CharSequence csq) throws IOException { final int length = csq.length(); for (int i = 0; i < length; ) { char c = csq.charAt(i++); if (c < 0x80) { _bytes[_index] = (byte) c; if (++_index >= _bytes.length) { flushBuffer(); } } else { write(c); } } }
/** * Writes the specified character sequence. * * @param csq the character sequence. * @throws IOException if an I/O error occurs */ public void write(CharSequence csq) throws IOException { final int length = csq.length(); for (int i = 0; i < length; ) { char c = csq.charAt(i++); if (c < 0x80) { _bytes[_index] = (byte) c; if (++_index >= _bytes.length) { flushBuffer(); } } else { write(c); } } }
/** * Writes the specified character sequence. * * @param csq the character sequence. * @throws IOException if an I/O error occurs */ public void write(CharSequence csq) throws IOException { final int length = csq.length(); for (int i = 0; i < length; ) { char c = csq.charAt(i++); if (c < 0x80) { _bytes[_index] = (byte) c; if (++_index >= _bytes.length) { flushBuffer(); } } else { write(c); } } }
/** * Writes the specified character sequence. * * @param csq the character sequence. * @throws IOException if an I/O error occurs */ public void write(CharSequence csq) throws IOException { final int length = csq.length(); for (int i = 0; i < length; ) { char c = csq.charAt(i++); if (c < 0x80) { _bytes[_index] = (byte) c; if (++_index >= _bytes.length) { flushBuffer(); } } else { write(c); } } }
/** * Writes a portion of an array of characters. * * @param cbuf the array of characters. * @param off the offset from which to start writing characters. * @param len the number of characters to write. * @throws IOException if an I/O error occurs. */ @Override public void write(char cbuf[], int off, int len) throws IOException { final int off_plus_len = off + len; for (int i = off; i < off_plus_len; ) { char c = cbuf[i++]; if (c < 0x80) { _bytes[_index] = (byte) c; if (++_index >= _bytes.length) { flushBuffer(); } } else { write(c); } } }
/** * Writes a portion of an array of characters. * * @param cbuf the array of characters. * @param off the offset from which to start writing characters. * @param len the number of characters to write. * @throws IOException if an I/O error occurs. */ @Override public void write(char cbuf[], int off, int len) throws IOException { final int off_plus_len = off + len; for (int i = off; i < off_plus_len; ) { char c = cbuf[i++]; if (c < 0x80) { _bytes[_index] = (byte) c; if (++_index >= _bytes.length) { flushBuffer(); } } else { write(c); } } }
/** * Writes a portion of a string. * * @param str a String. * @param off the offset from which to start writing characters. * @param len the number of characters to write. * @throws IOException if an I/O error occurs */ @Override public void write(String str, int off, int len) throws IOException { final int off_plus_len = off + len; for (int i = off; i < off_plus_len; ) { char c = str.charAt(i++); if (c < 0x80) { _bytes[_index] = (byte) c; if (++_index >= _bytes.length) { flushBuffer(); } } else { write(c); } } }
/** * Writes a portion of a string. * * @param str a String. * @param off the offset from which to start writing characters. * @param len the number of characters to write. * @throws IOException if an I/O error occurs */ @Override public void write(String str, int off, int len) throws IOException { final int off_plus_len = off + len; for (int i = off; i < off_plus_len; ) { char c = str.charAt(i++); if (c < 0x80) { _bytes[_index] = (byte) c; if (++_index >= _bytes.length) { flushBuffer(); } } else { write(c); } } }
/** * Writes a portion of an array of characters. * * @param cbuf the array of characters. * @param off the offset from which to start writing characters. * @param len the number of characters to write. * @throws IOException if an I/O error occurs. */ @Override public void write(char cbuf[], int off, int len) throws IOException { final int off_plus_len = off + len; for (int i = off; i < off_plus_len; ) { char c = cbuf[i++]; if (c < 0x80) { _bytes[_index] = (byte) c; if (++_index >= _bytes.length) { flushBuffer(); } } else { write(c); } } }
/** * Writes a portion of a string. * * @param str a String. * @param off the offset from which to start writing characters. * @param len the number of characters to write. * @throws IOException if an I/O error occurs */ @Override public void write(String str, int off, int len) throws IOException { final int off_plus_len = off + len; for (int i = off; i < off_plus_len; ) { char c = str.charAt(i++); if (c < 0x80) { _bytes[_index] = (byte) c; if (++_index >= _bytes.length) { flushBuffer(); } } else { write(c); } } }
/** * Writes a portion of a string. * * @param str a String. * @param off the offset from which to start writing characters. * @param len the number of characters to write. * @throws IOException if an I/O error occurs */ @Override public void write(String str, int off, int len) throws IOException { final int off_plus_len = off + len; for (int i = off; i < off_plus_len; ) { char c = str.charAt(i++); if (c < 0x80) { _bytes[_index] = (byte) c; if (++_index >= _bytes.length) { flushBuffer(); } } else { write(c); } } }
/** * Writes a portion of an array of characters. * * @param cbuf the array of characters. * @param off the offset from which to start writing characters. * @param len the number of characters to write. * @throws IOException if an I/O error occurs. */ @Override public void write(char cbuf[], int off, int len) throws IOException { final int off_plus_len = off + len; for (int i = off; i < off_plus_len; ) { char c = cbuf[i++]; if (c < 0x80) { _bytes[_index] = (byte) c; if (++_index >= _bytes.length) { flushBuffer(); } } else { write(c); } } }