Hi there!
I am writing a custom archive format in JAVA (J2ME to be precise). The archiver works OK, however I have little problems with de-archiving.
How could I know how many bytes have been read when reading a UTF8 string thorough the readUTF
method? I know that the first two bytes of a string saved using writeUTF are a short value of the string's length, but I'd like a nicer solution.
Or is there any way to know how many bytes are left till the end of the DataInputStream (the available
method doesn't seem to return meaningful values). The stream was opened by a FileConnection, i.e. FileConnection.openDataInputStream
.
Thanks guys!