package pw.koj.jetstreem.core;

import java.nio.ByteBuffer;
import java.nio.channels.Channel;
import java.nio.channels.ReadableByteChannel;
import java.io.IOException;

public class ChannelReadBuffer extends ChannelBuffer {
    public ChannelReadBuffer(Channel ch) {
        super(ch);
    }

    public int read() throws IOException {
        ReadableByteChannel c = (ReadableByteChannel)this.ch;
        return c.read(this.buf);
    }
}


@@ -53,16 +53,44 @@
 Buffer;%0A
+import java.nio.CharBuffer;%0A
 import j
@@ -458,11 +458,585 @@
 ;%0A    %7D%0A
+%0A    public void getChar(char%5B%5D ch) %7B%0A        this.buf.asCharBuffer().get(ch);%0A    %7D%0A%0A    public char%5B%5D subCharSequence(char ch) %7B%0A        int start;%0A        int end;%0A        CharBuffer cbuf = this.buf.asCharBuffer();%0A%0A        start = cbuf.position();%0A        end = cbuf.limit();%0A        int n;%0A        for (n = start; n %3C= end; n++) %7B%0A            if (cbuf.get(n) == ch) break;%0A        %7D%0A%0A        if (n %3E end) %7B%0A            return null;%0A        %7D%0A        else %7B%0A            char%5B%5D c = new char%5Bn - start + 1%5D;%0A            cbuf.get(c);%0A            return c;%0A        %7D%0A    %7D%0A%0A
 %7D%0A%0A

add getChar(), subCharSequence() to ChannelReadBuffer