×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Mar 2007
    Posts
    2

    Lightbulb How to read binary large binary file from...

    Who knows, how to :
    1. read large (20Mb) binary file from specified position, for specified amount of data? example how to read 300 bites from position 56000, from file 20Mb.
    I have to save resources , so I can't and I don't want to read all file.
    2. how to attach binary file to JAR file, to distribute up to phone?

  2. #2
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: How to read binary large binary file from...

    gaudeamus,

    Is there any way of creating the functionality you are after, without reading small part of a big big file? In most cases these reource files can be included inside the JAR-file. In this case the size of the file is so big that even after some zip-compression the JAR file is too large for many, many phones.
    Are you sure you need to have that large file inside your jar. What are you trying to achieve?

    Hartti

  3. #3
    Regular Contributor
    Join Date
    Jul 2005
    Posts
    79

    Re: How to read binary large binary file from...

    gaudeamus1313,

    Your question is not clear.
    If you are talking about to read 20MB binary file (may be in chunks) from some location(position) and want to save read data in phone memory.

    Then probably - noboby knows it.

  4. #4
    Regular Contributor
    Join Date
    Aug 2006
    Location
    Rawalpindi, Pakistan
    Posts
    486

    Re: How to read binary large binary file from...

    gaudeamus1313. harti is absolutely right. if u could tell us about what u plan to do may be we can come up with an alternative way. one thing is for sure. we have to reduce the file size somehow. also u have urself said u dont want to read all of the file. if thats so why cant u just save the data u need in a separate file and include that as resource.
    Last edited by nicenouman; 2007-03-20 at 07:47.
    Regards
    Nouman

  5. #5
    Registered User
    Join Date
    Mar 2007
    Posts
    2

    Re: How to read binary large binary file from...

    I want to make translator for terms (definition - description). I have text file final size 4-20Mb (it depends from amount of data). It is "clear text" file and for mobile devices it is big. I have second file that contain index (index it is mean: definition, start position, how many bytes you need to read). I want to read it from some position, for specified amount of data. Do you think 20Mb it is to much for mobile phone? Do you know how to do it, and how to read it from JAR? I saw only information how read all file, but it make overflow on phone (to big).

  6. #6
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: How to read binary large binary file from...

    My suggestion: Store the dictionary data on a server and request the data from there. After the system has been used a little while, you can create a new version of the midlet and store the most requested words with the MIDlet so no network connection is used for every query.

    Cons: user pays for the network connection (usually), also there are confirmation dialogs shown for network access

    Hartti

Similar Threads

  1. read string from text file problem
    By sim.sim in forum Symbian
    Replies: 9
    Last Post: 2006-05-24, 07:41
  2. MMS File Compression & WAP Binary Encoding
    By GregEdwards in forum General Messaging
    Replies: 1
    Last Post: 2005-05-14, 08:33
  3. Replies: 0
    Last Post: 2002-06-10, 12:24
  4. Loading images from byte array on 6130i
    By enlightment in forum Mobile Java General
    Replies: 2
    Last Post: 2002-06-05, 19:44

Posting Permissions

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