java.io.PrintWriter.setError()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(4.9k)|赞(0)|评价(0)|浏览(119)

本文整理了Java中java.io.PrintWriter.setError()方法的一些代码示例,展示了PrintWriter.setError()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。PrintWriter.setError()方法的具体详情如下:
包路径:java.io.PrintWriter
类名称:PrintWriter
方法名:setError

PrintWriter.setError介绍

[英]Sets the error flag of this writer to true.
[中]将此写入程序的错误标志设置为true。

代码示例

代码示例来源:origin: robovm/robovm

private final void doWrite(char[] buf, int offset, int count) {
  synchronized (lock) {
    if (out != null) {
      try {
        out.write(buf, offset, count);
      } catch (IOException e) {
        setError();
      }
    } else {
      setError();
    }
  }
}

代码示例来源:origin: robovm/robovm

/**
 * Ensures that all pending data is sent out to the target. It also
 * flushes the target. If an I/O error occurs, this writer's error
 * state is set to {@code true}.
 */
@Override
public void flush() {
  synchronized (lock) {
    if (out != null) {
      try {
        out.flush();
      } catch (IOException e) {
        setError();
      }
    } else {
      setError();
    }
  }
}

代码示例来源:origin: robovm/robovm

/**
 * Closes this print writer. Flushes this writer and then closes the target.
 * If an I/O error occurs, this writer's error flag is set to {@code true}.
 */
@Override
public void close() {
  synchronized (lock) {
    if (out != null) {
      try {
        out.close();
      } catch (IOException e) {
        setError();
      }
      out = null;
    }
  }
}

代码示例来源:origin: ESAPI/esapi-java-legacy

protected void setError() {
  super.setError();
}

代码示例来源:origin: com.gluonhq/robovm-rt

private final void doWrite(char[] buf, int offset, int count) {
  synchronized (lock) {
    if (out != null) {
      try {
        out.write(buf, offset, count);
      } catch (IOException e) {
        setError();
      }
    } else {
      setError();
    }
  }
}

代码示例来源:origin: MobiVM/robovm

private final void doWrite(char[] buf, int offset, int count) {
  synchronized (lock) {
    if (out != null) {
      try {
        out.write(buf, offset, count);
      } catch (IOException e) {
        setError();
      }
    } else {
      setError();
    }
  }
}

代码示例来源:origin: ibinti/bugvm

private final void doWrite(char[] buf, int offset, int count) {
  synchronized (lock) {
    if (out != null) {
      try {
        out.write(buf, offset, count);
      } catch (IOException e) {
        setError();
      }
    } else {
      setError();
    }
  }
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

private final void doWrite(char[] buf, int offset, int count) {
  synchronized (lock) {
    if (out != null) {
      try {
        out.write(buf, offset, count);
      } catch (IOException e) {
        setError();
      }
    } else {
      setError();
    }
  }
}

代码示例来源:origin: com.bugvm/bugvm-rt

private final void doWrite(char[] buf, int offset, int count) {
  synchronized (lock) {
    if (out != null) {
      try {
        out.write(buf, offset, count);
      } catch (IOException e) {
        setError();
      }
    } else {
      setError();
    }
  }
}

代码示例来源:origin: com.jtransc/jtransc-rt

private final void doWrite(char[] buf, int offset, int count) {
  synchronized (lock) {
    if (out != null) {
      try {
        out.write(buf, offset, count);
      } catch (IOException e) {
        setError();
      }
    } else {
      setError();
    }
  }
}

代码示例来源:origin: dragome/dragome-sdk

public void print(String str)
{
  try
  {
    out.write(str);
  }
  catch (IOException e)
  {
    setError();
  }
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

private void setError(Throwable th)
{
 
  super.setError();
  if (th instanceof IOException)
    _ioException=(IOException)th;
  else
  {
    _ioException=new IOException(String.valueOf(th));
    _ioException.initCause(th);
  }
  LOG.debug(th);
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp

private void setError(Throwable th)
{
 
  super.setError();
  if (th instanceof IOException)
    _ioException=(IOException)th;
  else
  {
    _ioException=new IOException(String.valueOf(th));
    _ioException.initCause(th);
  }
  LOG.debug(th);
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

private void setError(Throwable th)
{
 
  super.setError();
  if (th instanceof IOException)
    _ioException=(IOException)th;
  else
  {
    _ioException=new IOException(String.valueOf(th));
    _ioException.initCause(th);
  }
  LOG.debug(th);
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-server

private void setError(Throwable th)
{
 
  super.setError();
  if (th instanceof IOException)
    _ioException=(IOException)th;
  else
  {
    _ioException=new IOException(String.valueOf(th));
    _ioException.initCause(th);
  }
  LOG.debug(th);
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-plus

private void setError(Throwable th)
{
 
  super.setError();
  if (th instanceof IOException)
    _ioException=(IOException)th;
  else
  {
    _ioException=new IOException(String.valueOf(th));
    _ioException.initCause(th);
  }
  LOG.debug(th);
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

private void setError(Throwable th)
{
 
  super.setError();
  if (th instanceof IOException)
    _ioException=(IOException)th;
  else
  {
    _ioException=new IOException(String.valueOf(th));
    _ioException.initCause(th);
  }
  LOG.debug(th);
}

代码示例来源:origin: jenkinsci/winstone

private void setError(Throwable th)
{
  super.setError();
  if (th instanceof IOException)
    _ioException=(IOException)th;
  else
  {
    _ioException=new IOException(String.valueOf(th));
    _ioException.initCause(th);
  }
  if (LOG.isDebugEnabled())
    LOG.debug(th);
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.jetty.server

private void setError(Throwable th)
{
  super.setError();
  if (th instanceof IOException)
    _ioException=(IOException)th;
  else
  {
    _ioException=new IOException(String.valueOf(th));
    _ioException.initCause(th);
  }
  if (LOG.isDebugEnabled())
    LOG.debug(th);
}

代码示例来源:origin: Nextdoor/bender

private void setError(Throwable th)
{
 
  super.setError();
  if (th instanceof IOException)
    _ioException=(IOException)th;
  else
  {
    _ioException=new IOException(String.valueOf(th));
    _ioException.initCause(th);
  }
  if (LOG.isDebugEnabled())
    LOG.debug(th);
}

相关文章