1 /*******************************************************************************
2 * Copyright (c) 2000, 2003 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v10.html
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package net.sourceforge.phpdt.internal.corext.phpdoc;
13 import java.io.IOException;
14 import java.io.Reader;
16 public abstract class SingleCharReader extends Reader {
21 public abstract int read() throws IOException;
24 * @see Reader#read(char[],int,int)
26 public int read(char cbuf[], int off, int len) throws IOException {
28 for (int i = off; i < end; i++) {
45 public boolean ready() throws IOException {
50 * Gets the content as a String
52 public String getString() throws IOException {
53 StringBuffer buf = new StringBuffer();
55 while ((ch = read()) != -1) {
56 if (ch == '\n' || ch == '\r') {
59 buf.append((char) ch);
62 return buf.toString();