⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 outputstream.java

📁 ALGAE是一个快速创建算法演示的框架。目前支持的算法实现语言包括java和c
💻 JAVA
字号:
package edu.odu.cs.zeil.AlgAE.Server;import java.io.IOException;import edu.odu.cs.zeil.AlgAE.Server.MessageHandler;public class OutputStream extends java.io.OutputStream{  private StringBuffer buffer;  private MessageHandler msgs;    public OutputStream (MessageHandler handler)  {    buffer = new StringBuffer();    msgs = handler;  }    /**   * Writes the specified byte to this output stream.    *   * @param      b   the <code>byte</code>.   * @exception  IOException  if an I/O error occurs.   */  public void write(int b) throws IOException  {    buffer.append ((char)b);  }  /**   * Flushes this output stream and forces any buffered output bytes    * to be written out.    *   * @exception  IOException  if an I/O error occurs.   */  public void flush() throws IOException {    msgs.stdOutput (buffer.toString());    buffer = new StringBuffer();  }    /**     * Closes this output stream and releases any system resources      * associated with this stream.      *     * @exception  IOException  if an I/O error occurs.     */    public void close() throws IOException {      buffer = null;    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -