/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
*/
{
private volatile boolean isOpen = true;
if (!isOpen)
throw new IOException("Stream closed");
}
// Factories for java.io.OutputStreamWriter
throws UnsupportedEncodingException
{
try {
} catch (IllegalCharsetNameException x) { }
throw new UnsupportedEncodingException (csn);
}
{
}
{
}
// Factory for java.nio.channels.Channels.newWriter
int minBufferCap)
{
}
// -- Public methods corresponding to those in OutputStreamWriter --
// methods; the concrete stream-encoder subclasses defined below need not
// do any such checking.
if (isOpen())
return encodingName();
return null;
}
synchronized (lock) {
if (isOpen())
else
throw new IOException("Stream closed");
}
}
char cbuf[] = new char[1];
cbuf[0] = (char) c;
}
synchronized (lock) {
ensureOpen();
throw new IndexOutOfBoundsException();
} else if (len == 0) {
return;
}
}
}
/* Check the len before creating a char buffer */
if (len < 0)
throw new IndexOutOfBoundsException();
}
synchronized (lock) {
ensureOpen();
implFlush();
}
}
synchronized (lock) {
if (!isOpen)
return;
implClose();
isOpen = false;
}
}
private boolean isOpen() {
return isOpen;
}
// -- Charset-based stream encoder impl --
// Exactly one of these is non-null
// Leftover first char in a surrogate pair
private boolean haveLeftoverChar = false;
private char leftoverChar;
cs.newEncoder()
}
super(lock);
// This path disabled until direct buffers are faster
if (false && out instanceof FileOutputStream) {
}
}
}
: mbc);
}
if (rem > 0) {
assert false : rem;
} else {
}
}
}
throws IOException
{
if (!haveLeftoverChar && !endOfInput)
return;
else
if (haveLeftoverChar)
if (cr.isUnderflow()) {
if (lcb.hasRemaining()) {
return;
}
break;
}
if (cr.isOverflow()) {
writeBytes();
continue;
}
cr.throwException();
}
haveLeftoverChar = false;
}
throws IOException
{
if (haveLeftoverChar)
flushLeftoverChar(cb, false);
while (cb.hasRemaining()) {
if (cr.isUnderflow()) {
haveLeftoverChar = true;
}
break;
}
if (cr.isOverflow()) {
writeBytes();
continue;
}
cr.throwException();
}
}
writeBytes();
}
}
flushLeftoverChar(null, true);
try {
for (;;) {
if (cr.isUnderflow())
break;
if (cr.isOverflow()) {
writeBytes();
continue;
}
cr.throwException();
}
writeBytes();
else
} catch (IOException x) {
throw x;
}
}
return ((cs instanceof HistoricallyNamedCharset)
}
}