CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2009
    Posts
    26

    [RESOLVED] Copying files with InputStream/OutputStream instead of Reader/Writer

    My code is currently copying files using Reader/Writer but I need to do so using Input/Output Stream. How do I change my code to do that?
    Attached Files Attached Files

  2. #2
    dlorde is offline Elite Member Power Poster
    Join Date
    Aug 1999
    Location
    UK
    Posts
    10,163

    Re: Copying files with InputStream/OutputStream instead of Reader/Writer

    Please post the code inside CODE tags instead of just a link - some here are reluctant to follow posted links.

    The code in the copyFile method you supply is already using Input/Output streams - FileInputStream and FileOutputStream... the answer to your question is in your own code

    And simple truth miscalled simplicity,
    W. Shakespeare
    Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.

  3. #3
    Join Date
    Apr 2009
    Posts
    26

    Re: Copying files with InputStream/OutputStream instead of Reader/Writer

    Quote Originally Posted by dlorde View Post
    Please post the code inside CODE tags instead of just a link - some here are reluctant to follow posted links.

    The code in the copyFile method you supply is already using Input/Output streams - FileInputStream and FileOutputStream... the answer to your question is in your own code

    And simple truth miscalled simplicity,
    W. Shakespeare
    Okay I will next time =P

    How about in my Main class? I used BufferedReader/Writer. I was told not to use Reader/Writer because some tests will fail.

  4. #4
    dlorde is offline Elite Member Power Poster
    Join Date
    Aug 1999
    Location
    UK
    Posts
    10,163

    Re: Copying files with InputStream/OutputStream instead of Reader/Writer

    Quote Originally Posted by Backslash View Post
    How about in my Main class? I used BufferedReader/Writer. I was told not to use Reader/Writer because some tests will fail.
    OK, so what is stopping you switching to FileInputStream and FileOutputStream with BufferedInputStream and BufferedOutputStream?

    Imagination is more important than knowledge...
    A. Einstein
    Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.

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

Featured