×

Discussion Board

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

    Writing more than 1MB in a file

    Hi.
    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
    Location
    Rome, Italy
    Posts
    2,405

    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.

    Pit

  3. #3
    Registered User
    Join Date
    Oct 2008
    Posts
    2

    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. Theme Studio 3.1 not creating themes
    By zemm in forum Themes/Carbide.ui
    Replies: 11
    Last Post: 2008-10-18, 08:41
  2. Problem with pyobfuscate
    By JOM in forum Python
    Replies: 3
    Last Post: 2008-06-20, 22:47
  3. Reading and writing to file
    By rkuppala in forum Symbian C++
    Replies: 6
    Last Post: 2008-03-13, 09:59
  4. File reading & writing help, wav file redaing help
    By shubhamlahoti in forum Mobile Java General
    Replies: 6
    Last Post: 2007-06-27, 09:07
  5. Writing descriptor to file without length property
    By toshaga in forum Symbian C++
    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
  •