annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
1
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
2 package fdl;
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
3
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
4 import java.io.*;
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
5 import java.io.IOException;
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
6 import java.nio.*;
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
7
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
8 public class ByteBufferReader extends Reader {
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
9 public ByteBuffer _buf;
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
10
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
11 public ByteBufferReader(ByteBuffer buf) {
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
12 _buf = buf;
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
13 _buf.reset();
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
14 }
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
15
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
16 @Override
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
17 public int read(char[] cbuf, int off, int len) throws IOException {
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
18 // TODO Auto-generated method stub
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
19 for(int i=0;i<len;i++) {
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
20 cbuf[i]=_buf.getChar();
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
21 }
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
22 return len;
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
23 }
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
24
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
25 @Override
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
26 public void reset() {
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
27 _buf.reset();
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
28 }
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
29
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
30 @Override
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
31 public void close() throws IOException {
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
32 // TODO Auto-generated method stub
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
33
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
34 }
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
35
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
36 }