FileDocCategorySizeDatePackage
StreamReader.javaAPI DocJ2ME CLDC 1.12012Wed Feb 05 15:55:58 GMT 2003com.sun.cldc.i18n

StreamReader

public abstract class StreamReader extends Reader
General prototype for character converting stream readers.
author
Nik Shaylor
version
1.0 11/16/99
version
1.1 05/24/01

Fields Summary
public InputStream
in
Input stream to read from
Constructors Summary
Methods Summary
public voidclose()
Close the stream.

exception
IOException If an I/O error occurs

        in.close();
        in = null;
    
public voidmark(int readAheadLimit)
Mark the present position in the stream.

exception
IOException If an I/O error occurs

        if (in.markSupported()) {
            in.mark(readAheadLimit);
        } else {
            throw new IOException("mark() not supported");
        }
    
public booleanmarkSupported()
Tell whether this stream supports the mark() operation.

        return in.markSupported();
    
public java.io.Readeropen(java.io.InputStream in, java.lang.String enc)
Open the reader


        this.in = in;
        return this;
    
public booleanready()
Tell whether the underlying byte stream is ready to be read. Return false for those streams that do not support available(), such as the Win32 console stream.

        try {
            return in.available() > 0;
        } catch (IOException x) {
            return false;
        }
    
public voidreset()
Reset the stream.

exception
IOException If an I/O error occurs

        in.reset();
    
public abstract intsizeOf(byte[] array, int offset, int length)
Get the size in chars of an array of bytes