@@ -0,0 +1,1052 @@
+package to.etc.util;%0A%0Aimport java.io.*;%0A%0Aimport javax.annotation.*;%0A%0A/**%0A * A character stream wrapped around (part of) a character array.%0A *%0A * @author %3Ca href=%22mailto:jal@etc.to%22%3EFrits Jalvingh%3C/a%3E%0A * Created on Apr 3, 2013%0A */%0Apublic class CharReader extends Reader %7B%0A%09private final char%5B%5D%09m_data;%0A%0A%09private int%09%09%09%09m_soff;%0A%0A%09private int%09%09%09%09m_eoff;%0A%0A%09public CharReader(@Nonnull char%5B%5D data) %7B%0A%09%09m_data = data;%0A%09%09m_soff = 0;%0A%09%09m_eoff = data.length;%0A%09%7D%0A%0A%09public CharReader(@Nonnull char%5B%5D data, int soff, int eoff) %7B%0A%09%09m_data = data;%0A%09%09m_soff = soff;%0A%09%09m_eoff = eoff;%0A%09%7D%0A%0A%09@Override%0A%09public int read() throws IOException %7B%0A%09%09if(m_soff %3E= m_eoff)%0A%09%09%09return -1;%0A%09%09return m_data%5Bm_soff++%5D & 0xffff;%0A%09%7D%0A%0A%09@Override%0A%09public int read(char%5B%5D cbuf, int off, int len) throws IOException %7B%0A%09%09int rlen = m_eoff - m_soff;%09%09%09%09%09%09// This much we have left,%0A%09%09if(rlen %3C= 0)%0A%09%09%09return -1;%0A%09%09if(rlen %3E len)%0A%09%09%09rlen = len;%0A%09%09System.arraycopy(m_data, m_soff, cbuf, off, rlen);%0A%09%09m_soff += rlen;%0A%09%09return rlen;%0A%09%7D%0A%0A%09@Override%0A%09public void close() throws IOException %7B%0A%09%7D%0A%7D%0A

Add CharReader.