How can I copy and paste images' file?

I need to duplicate images' files (.jpeg or .gif) from a directory to another one.
How can I do?
Is there any method to do that?(with jdk1.3.1)
Thanks for your help.

The following class copies files. Just call "java FileCopier file1 file2". FileInputStream and FileOutputStream also accept File instances instead of Strings, which will help when you work with different directories.
// file: FileCopier.java
import java.io.*;
public class FileCopier {
  private String fileIn, fileOut;
  private int buffersize = 32768;
  public FileCopier(String fileIn, String fileOut) {
    this.fileIn = fileIn;
    this.fileOut = fileOut;
  public void copy() throws IOException {
    FileInputStream reader = new FileInputStream(fileIn);
    FileOutputStream writer = new FileOutputStream(fileOut);
    byte[] buffer = new byte[buffersize];
    int read;
    while( (read = reader.read(buffer, 0, buffersize)) > 0 ) {
      writer.write(buffer, 0, read);
    writer.flush();
  public static void main(String args[]) throws IOException {
    FileCopier copier = new FileCopier(args[0], args[1]);
    copier.copy();
}

Similar Messages

  • How can i copy and past music files, Images and Videos to my Apple Iphone?

    I have a new Iphone 4 mobile phone. Any one can  help me  for how can i stote music,videos and images files in My Iphone?
    When i search on internet i saw icloud and itunes. Is there any net connection requered to use icloud or itunes? Without net connect how can i store my files in my apple phone?

    Prabakhar,
    First, please verify that you mean CDDA and not CDA.  CDA is not an audio format.
    CDDA is pretty much the "raw" format of an audio CD.  It is extremely unusual to have it as a separate file.  If you still have the original CD that it came from, re-rip the CD using this document.  (Edit added.  I meant to add the link to this document:  http://support.apple.com/kb/PH12486  )
    Otherwise, a web search will turn up converters that can process a CDDA file, although I have not used them.
    Message was edited by: ed2345

  • How can I copy and paste a pdf file from my picture file and paste onto a document?

    How can i copy and paste a pdf file onto a document.  I am trying to place and article onto my
    Reverbnation Press page.  They only give you the option to either place a url link or paste a document.  There
    is no uploading for the Press page.  thanks, elena

    The Digital Editions forum is here, in case this is what you are talking about:
    http://forums.adobe.com/community/adobe_digital_editions
    If you are not, I apologize for the misunderstanding.

  • How can I copy and paste text into Word in Acrobat 9 Pro

    How can I copy and paste text into Word from Acrobat 9 Pro?

    You might find it easier to export the file to Word under File > Export > Word in Acrobat 9.

  • How can I copy and paste an entire page on the new Pages?

    How can I copy and paste an entire page on the new Pages?

    Open one document in Pages v5.5.3, Open a second document in Pages v5.5.3. Select, copy, and paste one page between source and destination documents. Document objects such as Text boxes, shapes, images, tables, etc must be individually selected, copied, and pasted.

  • I am having troubles with 3 things: scrolling with my laptop mouse, controlling my laptops volume with F9 and F10 keys, and I can not copy and paste images.

    I am having troubles with 3 things: scrolling with my laptop mouse, controlling my laptops volume with F9 and F10 keys, and I can not copy and paste images.

    Hello,
    Try disabling graphics hardware acceleration. Since this feature was added to Firefox, it has gradually improved, but there still are a few glitches.
    You might need to restart Firefox in order for this to take effect, so save all work first (e.g., mail you are composing, online documents you're editing, etc.).
    Then perform these steps:
    *Click the orange Firefox button at the top left, then select the "Options" button, or, if there is no Firefox button at the top, go to Tools > Options.
    *In the Firefox options window click the ''Advanced'' tab, then select "General".
    *In the settings list, you should find the ''Use hardware acceleration when available'' checkbox. Uncheck this checkbox.
    *Now, restart Firefox and see if the problems persist.
    Additionally, please check for updates for your graphics driver by following the steps mentioned in the following Knowledge base articles:
    [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]]
    [[Upgrade your graphics drivers to use hardware acceleration and WebGL]]
    volume controls issues are windows, not firefox.
    How your copy and paste your image? from where to where

  • How can I copy and paste the art work from album covers?

    How can I copy and paste the art work from album covers?

    I don't think the list style transfers. Copy and paste the text in to Mail, select it and then choose "Insert Numbered List" as a work around.

  • How can I copy and paste a pdf form onto my Mavericks Clipboard. I only see word-wrapped text.

    How can I copy and paste a pdf onto my Mavericks Clipboard. I only see word-wrapped text.

    Yes, Thank you for using the term Place. You moved my focus off the clipboard, and Place set me back on course. Somewhere, the terms Copy and Paste need to be tagged to Place and Export. I'm a database designer who only uses Illustrator for forms the database fills. My need isn't yet met, but the rest should come with reading the right references. Thanks Larry!

  • How can I copy and paste a simple document

    how can I copy and paste a simple document?

    highlight the text.  Command+c to copy, command+v to paste.

  • How can I copy and paste table cells from Pages into InDesign with minimum reformating?

    How can I copy and paste table cells from Pages into InDesign with minimum reformating?

    Do you mean you want to retain the formatting from Pages, or retain formatting already applied in ID?

  • How can I copy and paste my edited Photo in photoshop elements 12?

    How can I copy and paste my edited photo from photoshop elements 12 into a word document?

    In full Editor:
    Go to Select menu>all
    Go to Edit menu>copy to put it on the clipboard
    Go to your destination document>Paste
    Hope that this works for you as well.

  • How can I copy and paste a URL address?

    How can I copy and paste a URL address?

    Do you use chrome? Just double tap on the link and you will get the cut/copy options.
    All we have to decide is what to do with the time that is given to us - J.R.R. Tolkien

  • How can I copy and paste a long page here without using email?

    How can I copy and paste a long page without using email?

    Thanks for replying. Actually I want to copy/paste a recipe from a website so I can keep the recipe. On p 39 it tells how to copy/paste, which I do a lot already, but it doesn't tell where to paste it so I can access or print it whenever I want. It's kind of a long recipe. Too long to type out. Any ideas for that?

  • Can't copy and paste images that i've converted from pdf to word

    can't copy and paste images that i've converted from pdf to word

    The Reset Firefox feature can fix many issues by restoring Firefox to its factory default state while saving your essential information.
    Note: ''This will cause you to lose any Extensions, Open websites, and some Preferences.''
    To Reset Firefox do the following:
    #Go to Firefox > Help > Troubleshooting Information.
    #Click the "Reset Firefox" button.
    #Firefox will close and reset. After Firefox is done, it will show a window with the information that is imported. Click Finish.
    #Firefox will open with all factory defaults applied.
    Further information can be found in the [[Reset Firefox – easily fix most problems]] article.
    Did this fix your problems? Please report back to us!

  • I can't copy and paste images, both in Windows and Linux mozilla

    I can't copy and paste images when using Mozilla for Linux and Windows

    The Reset Firefox feature can fix many issues by restoring Firefox to its factory default state while saving your essential information.
    Note: ''This will cause you to lose any Extensions, Open websites, and some Preferences.''
    To Reset Firefox do the following:
    #Go to Firefox > Help > Troubleshooting Information.
    #Click the "Reset Firefox" button.
    #Firefox will close and reset. After Firefox is done, it will show a window with the information that is imported. Click Finish.
    #Firefox will open with all factory defaults applied.
    Further information can be found in the [[Reset Firefox – easily fix most problems]] article.
    Did this fix your problems? Please report back to us!

Maybe you are looking for

  • G/L Account F4 Help Error

    Dear Gurus,                    I am working in Extended Classic Scenario and when creating the Shopping cart and assigning the Cost Assignment where in when i am clicking the Find for G/L, there is an error message displayed like "Display Not Possibl

  • System setting does not allow changes to be made to object

    Hi experts,   I implelemt ST-PI/A today and apply note 1300023. There is a information(???) message keep warning "System setting does not allow changes to be made to object NOTE 0001300023". I think I should SE06 to modify system change option, but I

  • Can i load os x lion to my ipad2

    is it possible to use os x lion on my ipad 2

  • Material Document in IDOC.

    Hi, Can i find the Material Document number in IDOC display mode? I can find the Qty, Posting Date... Etc., but i could not find the material document in  IDOC in any of the Segment of message type: MBGMCR01. Regards, Kumar

  • Nokia n95 hangs

    nokia n95 hangs too much