Results 1 to 3 of 3

Thread: Copy - Paste in Java, fastest method

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2002
    Posts
    269

    Copy - Paste in Java, fastest method

    Hi everyone.

    I know java has no way of doing this by default but I can't seem to find a really good solution. I am making some software with copy paste file functionality built in and of course I need to be able to copy paste files as quickly as possible.

    Another thing I am trying to do which java won't let me do is find out the size of my hard drives and how much of them are used up.

    The copy paste problem is more important to me though. Anyone know of a quick way to transfer a file of say several megabytes.

    Thanks!
    KT

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Copy & Paste a file?

    Do you want to put a file reference into the clipboard, so you can later "paste" it to a different place like Explorer does? Or do you simply want to copy it?

    I'm afraid I can find no call that directly interfaces any system-level copy routines, so you'd have to copy yourself. Allocate a byte buffer about 32k large and just read that much in and write it out. Repeat until finished.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3
    Frenzied Member vbNeo's Avatar
    Join Date
    May 2002
    Location
    Jutland, Denmark
    Posts
    1,994
    or make it in C++ and use it in your application...
    "Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
    - Zack de la Rocha


    Hear me roar.

Posting Permissions

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



Click Here to Expand Forum to Full Width