diff options
Diffstat (limited to 'bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/BufferedLimitedReader.java')
-rw-r--r-- | bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/BufferedLimitedReader.java | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/BufferedLimitedReader.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/BufferedLimitedReader.java deleted file mode 100644 index f026bdab4b..0000000000 --- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/BufferedLimitedReader.java +++ /dev/null @@ -1,58 +0,0 @@ -package org.eclipse.wst.sse.core.internal.encoding.util; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.Reader; - -/** - * This is a pretty limited implementation, sort of specific - * to the way its used by tokenizers (JFlex). To really - * be general purpose, would need more work. - * - */ - - -public class BufferedLimitedReader extends BufferedReader { - private int limitedCount; - private int nRead; - - public BufferedLimitedReader(Reader reader, int size) { - super(reader, size); - if (reader.markSupported()) { - try { - mark(size); - } - catch (IOException e) { - // impossible - e.printStackTrace(); - } - } - limitedCount = size; - } - - public int read() throws IOException { - int result = 0; - nRead++; - if (nRead > limitedCount) { - result = -1; - } - else { - result = super.read(); - } - return result; - - } - - public int read(char cbuf[], int off, int len) throws IOException { - int result = 0; - if (nRead + len > limitedCount) { - result = -1; - } - else { - result = super.read(cbuf, off, len); - nRead = nRead + result; - } - return result; - } - -} |