Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Oct 2008

    Writing more than 1MB in a file

    I'm actually new into writing J2ME Apps. I'm having trouble with openOutputStream class since it only allows int as a write parameter. (ex: java.io.OutputStream.write(byte[] b, int off, int len) ).

    I'm affraid I'm using a wrong (or old) class, can anyone help me to append content to a file that's bigger than 1Mb (actually the higest value for an int).

    Thanks for your time.

  2. #2
    Nokia Developer Champion
    Join Date
    Nov 2007
    Rome, Italy

    Re: Writing more than 1MB in a file

    Hi Eco_023,

    welcome to Forum Nokia Discussion Boards!

    About your question: you can actually call write() as many times as you want, and so create bigger files. One hint: always be careful about memory management, to avoid incurring into OutOfMemoryExceptions.


  3. #3
    Registered User
    Join Date
    Oct 2008

    Re: Writing more than 1MB in a file

    Hi Pit. Thank you for your fast answer. It solved my problem but still I have a question.

    How could I (for example) change the 2.000.000 byte (any number overriding the int limit which I don't know right now) of a large file?

    Thanks in advance for the help.
    Last edited by Eco_023; 2008-11-14 at 17:21. Reason: Dummy mistake on my part.

Similar Threads

  1. Problem with pyobfuscate
    By JOM in forum Symbian
    Replies: 3
    Last Post: 2008-06-20, 22:47
  2. Reading and writing to file
    By rkuppala in forum Symbian
    Replies: 6
    Last Post: 2008-03-13, 09:59
  3. File reading & writing help, wav file redaing help
    By shubhamlahoti in forum Mobile Java General
    Replies: 6
    Last Post: 2007-06-27, 09:07
  4. Replies: 1
    Last Post: 2006-11-16, 19:51

Posting Permissions

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