Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Random Access File

  1. #1
    Junior Member Wish..'s Avatar
    Join Date
    Mar 2012
    Location
    sky !
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Random Access File

    Hi !

    My teacher asked me to do this ..

    write the program that code will write
    the following to a file i:10:a:22:Emma
    then, add code that will change only 10 to 2000.


    the problem is how can I write the code of change 10 to 2000 because they are different bytes ?
    this methods may help but I don't know how I use it : (

    writeChar()
    writeInt()


  2. #2
    Think of me.... Mr.777's Avatar
    Join Date
    Mar 2011
    Location
    Pakistan
    Posts
    1,136
    My Mood
    Grumpy
    Thanks
    20
    Thanked 82 Times in 78 Posts
    Blog Entries
    1

    Default Re: Random Access File

    Good Luck. This may help you SSCCE
    Anyone who stops learning is old, whether at twenty or eighty. Anyone who keeps learning stays young. The greatest thing in life is to keep your mind young.

    - Henry Ford

  3. #3
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    21,931
    Thanks
    55
    Thanked 2,353 Times in 2,324 Posts

    Default Re: Random Access File

    You will have to move the following bytes to the right to make room. That will be tricky because you can overwrite data that has not been moved yet.

Similar Threads

  1. [SOLVED] Access Denied when extracting zip file.
    By techwiz24 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: December 18th, 2011, 07:50 PM
  2. Accessing a random text file from within a folder?
    By RaustBD in forum Java Theory & Questions
    Replies: 1
    Last Post: November 29th, 2011, 01:13 PM
  3. Default Access (package access) confusion
    By gauravrajbehl in forum Java Theory & Questions
    Replies: 1
    Last Post: November 18th, 2009, 04:11 AM
  4. Random Access File
    By silver_unicorn in forum File I/O & Other I/O Streams
    Replies: 1
    Last Post: August 12th, 2009, 02:51 AM
  5. Random Access File
    By silver_unicorn in forum File I/O & Other I/O Streams
    Replies: 1
    Last Post: August 10th, 2009, 11:44 PM