public class NFilter { private StringBuffer buffer; private Read reader; public NFilter(Read read) { String temp; reader = read; if(null == (temp = reader.read(10))) { System.out.println("NULL"); buffer = null;return; } buffer = new StringBuffer(temp); } public String next() { String temp = null; if(buffer == null){System.out.println("NULL");return null;} if(9 < buffer.length()){ temp = buffer.substring(0,9); } else if(buffer.length() != 0) { temp =buffer.substring(0,buffer.length()); } else { temp = null; return temp; } String temp00; buffer.delete(0,1); if((temp00 = reader.read(1))!= null) { buffer.append(temp00); } return temp; } }