Java Reference
In-Depth Information
java.io
Table B.57. I n terfaces of the java.io Package
J2SE Interface
Availability in CLDC
DataInput
Partially contained; see Table B.60 for details.
DataOutput
Partially contained; see Table B.61 for details.
Externalizable
Not available in CLDC.
FileFilter
Not available in CLDC.
FilenameFilter
Not available in CLDC.
ObjectInput
Not available in CLDC.
ObjectInputValidation
Not available in CLDC.
ObjectOutput
Not available in CLDC.
ObjectStreamConstants
Not available in CLDC.
Serializable
Not available in CLDC.
Table B.58. Clas s es of the java.io Package
J2SE Class
Availability in CLDC
BufferedInputStream,
BufferedOutputStream
Not available in CLDC.
BufferedReader, BufferedWriter Not available in CLDC.
Workaround for readLine() using PC and UNIX
encoding:
static String readLine (Reader
reader) throws IOException {
StringBuffer buf = new
StringBuffer();
while (true) {
int c = reader.read();
if (c == -1) {
if (buf.length() == 0) return
null;
break;
}
if (c == '\n') break;
if (c != '\r') buf.append ((char)
c);
}
return buf.toString();
}
ByteArrayInputStream
All J2SE methods are available in CLDC.
ByteArrayOutputStream
Partially contained; see Table B.62 for details.
Not available in CLDC.
CharArrayReader ,
CharArrayWriter
Partially contained; see Table B.63 and B.64 for
d etails.
DataInputStream ,
DataOutputStream
File , FileDescriptor ,
FileInputStream ,
FilePermission , FileReader ,
FileWriter
Files not available in CLDC. Use the classes of the
javax.microedition.rms as an alternative. For
accessing files on memory cards, some devices
may provide a file:// protocol implementation in the
generic connection framework (see Chapter 6 ,
"Networking: The Generic Connection Framework").
 
Search WWH ::




Custom Search