Name

InputStreamReader

Synopsis

InputStreamReader is a subclass of Reader that reads bytes from an underlying 8-bit input stream and converts them to Unicode characters. The mapping of the bytes from the InputStream to the characters returned by the InputStreamReader is performed using the encoding specified in the constructor, or the default encoding of the host platform if the single-argument constructor is used. Note that InputStreamReader supports the mark() and reset() methods only if the underlying InputStream does.

CLDC devices typically support only their own default encoding. Hence, it is unlikely that many alternative encodings will be available. The CLDC specification does not provide any mechanism that would allow application code to determine the available encodings at runtime apart from the default encoding, which can be obtained from the system property microedition.encoding. The CLDC version of this class does not include the getEncoding() method from J2SE, which returns the name of the encoding used by an InputStreamReader.

                  Type Of
public class InputStreamReader extends Reader {  
// Public Constructors
   public InputStreamReader( InputStream is);  
   public InputStreamReader(InputStream is, 
        String enc) throws UnsupportedEncodingException;    
// Public Methods Overriding Reader
   public void close() throws IOException;  
   public void mark( int readAheadLimit) throws IOException; public ...

Get J2ME in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.