import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
+import java.nio.CharBuffer;
/** Efficient conversion of bytes to character .
*
{
try {
// read from the reader
- while( true ) { // conv.ready() ) {
+ while( iis.available()>0 ) { // conv.ready() ) {
int cnt=conv.read( result, 0, BUFFER_SIZE );
if( cnt <= 0 ) {
// End of stream ! - we may be in a bad state
return super.read( cbuf, off, len );
}
+ public final int read() throws IOException {
+ return super.read();
+ }
+
+ public final int read(CharBuffer cb) throws IOException {
+ return super.read(cb);
+ }
+
+ public final int read(char[] cbuf) throws IOException {
+ return super.read(cbuf);
+ }
+
/** Reset the buffer
*/
public final void recycle() {
public final int read() throws IOException {
return (pos < end ) ? (buf[pos++] & 0xff) : -1;
}
-
+
// -------------------- Internal methods --------------------
void setBuffer( byte b[], int p, int l ) {
end=pos+len;
}
+ public int available() throws IOException {
+ return end-pos;
+ }
+
+ public boolean markSupported() {
+ return false;
+ }
+
+ public int read(byte[] b) throws IOException {
+ return read(b,0,b.length);
+ }
+
+ /**
+ * Repositions this stream to the position at the time the <code>mark</code> method was last called on this input
+ * stream.
+ *
+ * @throws IOException if this stream has not been marked or if the mark has been invalidated.
+ * @todo Implement this java.io.InputStream method
+ */
+ public synchronized void reset() throws IOException {
+ //not implemented
+ }
+
+ public long skip(long n) throws IOException {
+ //not implemented
+ return 0L;
+ }
+
}