How do I read strings in J2ME?
问题 I'm using the MIDP 2.0 (JSR 118) and I just noticed that there is no reader for strings in J2ME. Does anyone know how you are supposed to read Strings from an InputStream or InputStreamReader in a platform independent way (i.e. between two java enabled cell phones of different models)? 回答1: Alternatively have a look at DataInputStream.readUTF(). It does required that the string being read off the InputStream be encoded appropriately (as in by a corresponding DataOutputStream.writeUTF(String))