×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Jan 2004
    Posts
    25

    why can i only read 512 bytes at once?

    hi,

    Im developing some apps at the minute using bluetooth and j2me and through trial and error, discovered that i can only read in 512 bytes at a time! (i'm using a datainputstream)

    so i was just wondering, what is this a limitation of? is it a feature of midp 2.0, of bluetooth, or of the nokia 6600 that im using?

    cheers

  2. #2
    Regular Contributor
    Join Date
    Jun 2003
    Location
    Hungary
    Posts
    414
    This is a known issue of the Developer Platform for S60 v2.0.
    read more >>

  3. #3
    Registered User
    Join Date
    Jan 2004
    Posts
    25
    okay, you mean this:

    "Reading Resources from a JAR File Description:

    The MIDP2.0/Monty implementation for the InputStream.read(byte[]) method in the Nokia 6600 phone takes a literal reading of the definitions of java.io.InputStream.read(bytes[] b) and java.io.InputStream.read(byte[] b, int off, int len), which indicate that these functions might NOT read the number of bytes equal to the size of the array argument (b.length) before returning, and will indicate the number of bytes that were successfully read as a return value.

    This is basically because it is a more optimized approach for the implementation. NOTE: As all other InputStream classes (DataInputStream, ByteArrayInputStream etc) are subclasses of InputStream, this issue is the same for ALL InputStream operations."

    So, I take it then, that other J2ME devices wouldn't have this limitation, only the Nokia 6600 or other series 60 devices?

  4. #4
    Regular Contributor
    Join Date
    Jun 2003
    Location
    Hungary
    Posts
    414
    Don't forget it is not a bug!
    It may happen on other devices too.
    Put your read method in a whie loop and it will "portable".

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×