writeUTF() 和 readUTF() 分别是DataOutputStream 和 DataInputStream对象的的方法,他们提供了一个由从Unicode到UTF-8的相互转化的途径。
仔细看看midp的说明文档,可以看到以下内容
writeUTF() :
First, two bytes are written to the output stream as if by the writeShort method giving the number o
f bytes to follow. This value is the number of bytes actually written out, not the length of the str
ing. Following the length, each character of the string is output, in sequence, using the UTF-8 enco
ding for the character.If no exception is thrown, the counter written is incremented by the total nu
mber of bytes written to the output stream. This will be at least two plus the length of str, and at
most two plus thrice the length of str.