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

📄 buffercontentreader.java

📁 A framework written in Java for implementing high-level and dynamic languages, compiling them into J
💻 JAVA
字号:
//This is free software;  for terms and warranty disclaimer see ./COPYING.package gnu.jemacs.swt;import java.io.IOException;import java.io.Reader;/** * @author Christian Surlykke *         31-07-2004 */public class BufferContentReader extends Reader{  private boolean closed = false;  private BufferContent bufferContent;  private int start;  private int count;    /**   *    */  public BufferContentReader(BufferContent bufferContent, int start, int count)  {    super();    this.bufferContent = bufferContent;    this.start = start;    this.count = Math.min(bufferContent.size() - start, count);  }  /**   * @see java.io.Reader#close()   */  public void close() throws IOException  {    closed = true;  }  /**   * @see java.io.Reader#read(char[], int, int)   */  public int read(char[] cbuf, int off, int len) throws IOException  {    if (closed)    {      throw new IOException();    }        if (count <= 0)    {      return -1;    }    else    {      int chars = Math.min(this.count, len);      bufferContent.getChars(start, start + chars, cbuf, off);      start += chars;      count -= chars;      return chars;    }  }}

⌨️ 快捷键说明

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