2 * License : The MIT License
3 * Copyright(c) 2009 olyutorskii
6 package jp.sourceforge.jovsonz;
8 import java.io.IOException;
9 import java.io.StringReader;
10 import java.nio.CharBuffer;
14 * 以降の読み出しで自動的にIOExceptionを投げるStringReader。
16 public class TroubleReader extends StringReader{
18 private final int limit;
21 public TroubleReader(String text, int limit){
28 public int read() throws IOException{
29 if(this.ct >= this.limit) throw new IOException();
35 public int read(char[] cbuf){
36 throw new UnsupportedOperationException();
40 public int read(char[] cbuf, int off, int len){
41 throw new UnsupportedOperationException();
45 public int read(CharBuffer target){
46 throw new UnsupportedOperationException();
50 public long skip(long ns){
51 throw new UnsupportedOperationException();