Mercurial > hg > FederatedLinda
view src/fdl/ByteBufferReader.java @ 7:1809e2b05824
Initial revision
author | fuchita |
---|---|
date | Sat, 16 Feb 2008 13:12:52 +0900 |
parents | 083a0b5e12cc |
children | 35375016b2f0 |
line wrap: on
line source
package fdl; import java.io.*; import java.io.IOException; import java.nio.*; public class ByteBufferReader extends Reader { public ByteBuffer _buf; public ByteBufferReader(ByteBuffer buf) { _buf = buf; _buf.reset(); } @Override public int read(char[] cbuf, int off, int len) throws IOException { // TODO Auto-generated method stub for(int i=0;i<len;i++) { cbuf[i]=_buf.getChar(); } return len; } @Override public void reset() { _buf.reset(); } @Override public void close() throws IOException { // TODO Auto-generated method stub } }