Results 1 to 2 of 2
  1. #1
    at_mds is offline Member
    Join Date
    Nov 2011
    Posts
    1
    Rep Power
    0

    Default Copying from large input stream to byte array

    Hello All,

    i am getting problem in copying large amount of data from input stream to byte array or to file..

    I have data of about 400Mb in my input stream and i need to copy it to an byte array or a file...

    i have tried with apache common api..
    FileCopyUtils.copyToByteArray() and also tried with IOutils but it takes so much time arounf 12-15 minutes..

    can any one help me how can i copy data from input stream to byte array in fast manner..or if there are some API's though which it can be possible then please let me know..



    Thanks

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,308
    Rep Power
    25

    Default Re: Copying from large input stream to byte array

    Do you define the byte array to be 400Mb(50MB @8b per B) before trying to read data into it so that it does not need to be resized?

    Do you have a small program that compiles and executes (SSCCE) that you can post to show how you are trying to do it?

Similar Threads

  1. Replies: 15
    Last Post: 04-12-2011, 03:42 PM
  2. Copying large files efficiently
    By bayan in forum New To Java
    Replies: 2
    Last Post: 10-27-2010, 05:01 PM
  3. BufferedReader alternative for large input
    By HannesV in forum Advanced Java
    Replies: 0
    Last Post: 10-19-2010, 04:56 PM
  4. How do I know that byte of stream is finished?
    By mani_minhaj in forum New To Java
    Replies: 2
    Last Post: 02-26-2010, 12:08 PM
  5. raw byte stream to image
    By nupurashi in forum Advanced Java
    Replies: 2
    Last Post: 01-29-2009, 07:48 AM

Posting Permissions

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