/** * Flushes the stream. If the stream has saved any characters from the * various write() methods in a buffer, write them immediately to their * intended destination. Then, if that destination is another character or * byte stream, flush it. Thus one flush() invocation will flush all the * buffers in a chain of Writers and OutputStreams. * * @throws IOException if an I/O error occurs. */ @Override public void flush() throws IOException { flushBuffer(); _outputStream.flush(); }
/** * Closes and {@link #reset resets} this writer for reuse. * * @throws IOException if an I/O error occurs */ @Override public void close() throws IOException { if (_outputStream != null) { flushBuffer(); _outputStream.close(); reset(); } }
_bytes[_index] = (byte) (0xc0 | (c >> 6)); if (++_index >= _bytes.length) { flushBuffer(); flushBuffer(); flushBuffer(); flushBuffer(); flushBuffer(); flushBuffer(); flushBuffer(); flushBuffer(); flushBuffer(); flushBuffer(); flushBuffer(); flushBuffer(); flushBuffer(); flushBuffer();
/** * Writes a character given its 31-bits Unicode. * * @param code the 31 bits Unicode of the character to be written. * @throws IOException if an I/O error occurs. */ @Override public void write(int code) throws IOException { if ((code & 0xffffff80) == 0) { _bytes[_index] = (byte) code; if (++_index >= _bytes.length) { flushBuffer(); } } else { // Writes more than one byte. write2(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 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); } } }
/** * Flushes the stream. If the stream has saved any characters from the * various write() methods in a buffer, write them immediately to their * intended destination. Then, if that destination is another character or * byte stream, flush it. Thus one flush() invocation will flush all the * buffers in a chain of Writers and OutputStreams. * * @throws IOException if an I/O error occurs. */ @Override public void flush() throws IOException { flushBuffer(); _outputStream.flush(); }
/** * Flushes the stream. If the stream has saved any characters from the * various write() methods in a buffer, write them immediately to their * intended destination. Then, if that destination is another character or * byte stream, flush it. Thus one flush() invocation will flush all the * buffers in a chain of Writers and OutputStreams. * * @throws IOException if an I/O error occurs. */ @Override public void flush() throws IOException { flushBuffer(); _outputStream.flush(); }
/** * Flushes the stream. If the stream has saved any characters from the * various write() methods in a buffer, write them immediately to their * intended destination. Then, if that destination is another character or * byte stream, flush it. Thus one flush() invocation will flush all the * buffers in a chain of Writers and OutputStreams. * * @throws IOException if an I/O error occurs. */ @Override public void flush() throws IOException { flushBuffer(); _outputStream.flush(); }
/** * Flushes the stream. If the stream has saved any characters from the * various write() methods in a buffer, write them immediately to their * intended destination. Then, if that destination is another character or * byte stream, flush it. Thus one flush() invocation will flush all the * buffers in a chain of Writers and OutputStreams. * * @throws IOException if an I/O error occurs. */ @Override public void flush() throws IOException { flushBuffer(); _outputStream.flush(); }
/** * Closes and {@link #reset resets} this writer for reuse. * * @throws IOException if an I/O error occurs */ @Override public void close() throws IOException { if (_outputStream != null) { flushBuffer(); _outputStream.close(); reset(); } }
/** * Closes and {@link #reset resets} this writer for reuse. * * @throws IOException if an I/O error occurs */ @Override public void close() throws IOException { if (_outputStream != null) { flushBuffer(); _outputStream.close(); reset(); } }
/** * Closes and {@link #reset resets} this writer for reuse. * * @throws IOException if an I/O error occurs */ @Override public void close() throws IOException { if (_outputStream != null) { flushBuffer(); _outputStream.close(); reset(); } }
/** * Closes and {@link #reset resets} this writer for reuse. * * @throws IOException if an I/O error occurs */ @Override public void close() throws IOException { if (_outputStream != null) { flushBuffer(); _outputStream.close(); reset(); } }
/** * Writes a character given its 31-bits Unicode. * * @param code the 31 bits Unicode of the character to be written. * @throws IOException if an I/O error occurs. */ @Override public void write(int code) throws IOException { if ((code & 0xffffff80) == 0) { _bytes[_index] = (byte) code; if (++_index >= _bytes.length) { flushBuffer(); } } else { // Writes more than one byte. write2(code); } }
/** * Writes a character given its 31-bits Unicode. * * @param code the 31 bits Unicode of the character to be written. * @throws IOException if an I/O error occurs. */ @Override public void write(int code) throws IOException { if ((code & 0xffffff80) == 0) { _bytes[_index] = (byte) code; if (++_index >= _bytes.length) { flushBuffer(); } } else { // Writes more than one byte. write2(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 character given its 31-bits Unicode. * * @param code the 31 bits Unicode of the character to be written. * @throws IOException if an I/O error occurs. */ @Override public void write(int code) throws IOException { if ((code & 0xffffff80) == 0) { _bytes[_index] = (byte) code; if (++_index >= _bytes.length) { flushBuffer(); } } else { // Writes more than one byte. write2(code); } }
/** * Writes a character given its 31-bits Unicode. * * @param code the 31 bits Unicode of the character to be written. * @throws IOException if an I/O error occurs. */ @Override public void write(int code) throws IOException { if ((code & 0xffffff80) == 0) { _bytes[_index] = (byte) code; if (++_index >= _bytes.length) { flushBuffer(); } } else { // Writes more than one byte. write2(code); } }