view src/fdl/ByteBufferReader.java @ 0:083a0b5e12cc

Apply Debug Interface version start
author fuchita
date Thu, 07 Feb 2008 14:21:30 +0900
parents
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
		
	}

}