Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User cyberfish's Avatar
    Join Date
    Mar 2009
    Posts
    9
    Hi,

    My program needs random access to a binary file, and since DataInputStream (or InputStream) don't support seeking backwards, I'm thinking about opening multiple InputStreams, every time I need to go backwards, and then "skip()" from there.

    Does that work?

    Are newly opened InputStreams positioned at the beginning of the file?

    openOutputStream has an overloaded version that takes an offset, but apparently openInputStream doesn't for some reason.

    Also, is skip(long) efficiently implemented in devices? Or is it read and chuck... (the emulator seems to have "real" seek)

    Many thanks!

  2. #2
    Registered User cyberfish's Avatar
    Join Date
    Mar 2009
    Posts
    9
    I just tried it out on the emulator and all DataInputStream's are positioned at the beginning! Great!

    Now the only question that remains is -

    Is "skip()" implemented efficiently on phones? (I don't think testing that in the emulator would be enough... and I don't have my phone with me at the moment)

    Thanks

  3. #3
    Super Contributor arpit2agrawal's Avatar
    Join Date
    Jan 2008
    Location
    Amravati, India
    Posts
    546
    skip(1MB) takes:
    5 milliseconds on Nokia 3110 classic
    10 seconds on Nokia E61i
    JSR 75 is really inefficient on S60 phones

  4. #4
    Registered User cyberfish's Avatar
    Join Date
    Mar 2009
    Posts
    9
    I see. Thanks.

Similar Threads

  1. 调用OpenC/C++的问题
    By shaojieli in forum Symbian
    Replies: 32
    Last Post: 2008-08-20, 09:48
  2. FileConnection & Motorola V195
    By arnaultp in forum Mobile Java General
    Replies: 3
    Last Post: 2008-07-08, 16:52
  3. FileConnection for files inside jar
    By ben-efiz in forum Mobile Java General
    Replies: 1
    Last Post: 2008-03-13, 22:36
  4. (FileConnection) Share apps between 6600 and 6630
    By matteopiccioni in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2006-06-21, 21:59
  5. Java FileConnection Optional Package 1.0 (JSR 75)
    By thecrowi in forum Mobile Java General
    Replies: 0
    Last Post: 2004-09-24, 08:29

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved