Why is file size increasing while copiying contents of the file.

Hi,
Iam copying the contents of a file to another file using streams.But while doing this the size of the destination file is greater than the source file.For example, if iam copying the contents of file A whose size is 78 KB into file B then the size of B is 80 KB. Any body please explain the reason for this.The code i used for copying is given below.
Thanks in advance.
public static boolean copyFile(File srcFile,File destFile){
          FileInputStream fis = null;
          FileOutputStream fos = null;
          boolean isCopySucess = false;
          //============================================
          int ReadBytes = 0;
          int BUFSIZ = 4096;
          long fileSize ;
          long copiedBytes=0;
          try
                    fis = new FileInputStream(srcFile);
                    fos = new FileOutputStream(destFile);
                    fileSize = srcFile.length();
                    byte Buf[] = new byte[BUFSIZ];
                    while(copiedBytes < fileSize)
                         ReadBytes = fis.read(Buf, 0, BUFSIZ);
                         fos.write(Buf);
                         copiedBytes +=ReadBytes;
                    isCopySucess = true;
          }catch(Exception ex)
               isCopySucess = false;
               ex.printStackTrace();
          //============================================
          finally{
               try {
                    if(fis != null)
                         fis.close();
                    if(fos != null)
                         fos.close();
               } catch (final IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
               return isCopySucess;
     }

ReadBytes = fis.read(Buf, 0, BUFSIZ);
fos.write(Buf, 0, ReadBytes);

Similar Messages

  • File size increases dramatically after digital signature with Acrobat X

    I signed a PDF file using Acrobat X.
    File size of unsigned document: 200 k
    File size of signed document: 3200 k (more than ten times bigger)
    Any idea?
    BR
    Harald

    Finally I found the solution.
    The file size increase is a result of the embedded information used for long-term signature validation.
    If you do not need this feature, you can turn it off:
    Preferences > Security > Advanced Preferences > Creation tab
    disable "Include Signature’s Revocation"
    Help page: http://help.adobe.com/en_US/acrobat/X/pro/using/WS934c23d7cc8877da1172e0811fde233c98-8000. html
    BR
    Harald

  • Why is the file size increasing when cropping in Photoshop CC?

    While cropping a picture the file size is increasing dramatically.
    An image 7360 X 4912 px (Image size : 103,4M) after cropping to 60 X 40 cm 300 px, goes up to an image of 18000 X 12000 px (Image size : 618,0 M). And the computer is unable to cope with such a file...
    It wasn't like that when I first started to use the program.
    I crop the same image using CS5 and the result is an image of 7087 X 4724 px (Image size : 95,8 M) which is normal...
    Will aprreciate help...

    Thanks for replying. First I didn't have this problem in the beginning. I do the same in CS5 and I can do it with no problem.

  • Why do my photo file size increases upon export?!?!

    This is driving me nuts. I have Aperture 1.5.2 referencing an iPhoto library. When I look at the metadata toolset I can see each photo's file size. I have all my photos already resized to fit in an 800x800px box. When I export through Aperture using "export version jpeg original" I get an increased file size. When I export using the master version I don't. I went through and added iptc caption data that only seems to export with the version not the master. I can't believe a line of txt adds so noticeably to the file size. If I need to export my photos with the iptc caption data and want to retain my original file sizes how should I go about it?
    Thanks,
    Michael

    chuck,
    it all depends on 2 factors. a - your original file (pixel dimensions, format, compression level, color and bit depth) and the exported file (pixel dimensions, format, compression level, color and bit depth).
    just as an example - if you take a quite strongly compressed jpg (lets say at 5) and export it to be a less compressed jpg (10 to 12), the file size in kb will be larger, while maintaining the same amount of pixels. what has changed is the way the information are stored within the jpg +(to say it very simplified and without going into details about compression and possible loss of data etc)+.
    if you'd take a high-res 16-bit tif and export it (again at exact same pixel dimensions) as jpg, you'd get a much smaller file, still the same pixels (at least the amount of pixels, however perhaps "lower quality" pixels, depending on compression level, original image, noise, tonality etc etc).
    long (technical) story short: there is no real "one answer fits all" because it heavily depends on your original image. as a rule of thumb however, print files should be in 300 dpi and images for the web in 72.
    in terms of color and bit depth it now depends who you're sending the files to. if you send them to your client, use 8 bit sRGB. if you send it to a graphic designer, i'd send him 16-bit tif files in adobe rgb. all of this makes no sense if your original image was a heavily compressed 8 bit sRGB jpg of course.

  • Why does PDF file size increase each time I "save" tagging tasks?

    Why does PDF file size increase each time I "save" tagging tasks?
    Given:
    1) I'm running Acrobat Pro 11.0.07 (this is most current version)
    2) My file size starts at 750mb and ends up 15mb when finished tagging.
    3) Only certain documents experience this increase, i.e., no visible pattern of document characteristics
    4) PDF's are not full of images...in fact, mostly <H1> <H2> <H3> <P> <Figure> alt text, ect.
    5) Occurs with text PDF's and/or fillable forms (again, does not happen to all documents...only some)
    6) File increase occurs incrementally as tagging tasks are performed; i.e., each new save increases file size a few megabytes.
    7) Occurs whether I "save" or "save as"
    8) Difficult to optimize these files without corruption
    9) I'm running Mac OS 10.9.4 (this is most current version)

    Thank you so much for responding! I've been experimenting with the SAVE AS vs. SAVE for the past few days...and you are correct. It's funny because I've been tagging files for 2 years and never noticed this. Probably b/c I use both methods depending on the tagging tasks...some are more complicated than others and should not be overwritten. In those cases I SAVE AS new file.
    I love this forum...thank you again!

  • File sizes increase in StarOffice 8

    I've got a letter I send out about once a month, just changing dates in the contents for each edition. It has a linked .jpg file as background.
    In StarOffice 7 the .sxw file size is 8 Kb.
    In StarOffice 8 the size has leapt to 44 Kb, whether I save it in .sxw or .odt format.
    Why?

    I find that file sizes increase both with text documents and with spreadsheets, sometimes by a great deal. One of the reasons I switched from 5.2 to 7 was the much smaller file sizes, since I keep my weekly back-ups on floppies (and am a stingy sort of fellow generally). But I had to run 7 and 5.2 together, since 7 does not handle Sanskrit/Hindi founts (the SO "help" team just asked a whole lot of questions and then disappeared). So now I have (on Windows) 5.2, 7 and 8. I have still not checked if 8 handles these founts. If it does, I can remove 5.2. For the rest, 8 does not seem to offer any advantage over 7 -- not counting the data base, which I have still to look into. File size, in my view, goes against it.

  • Pdf file size increases when printing resulting in slow print speed.

    I have a .pdf that is saved at 27MB. When I send it to an HP Designjet T520 36in printer the file size jumps up to 136MB and the printing is incredibly slow. This does not happen on all files on a few random ones. Any ideas on how to resolve this issue?

    It's entirely normal for file size to increase. PDFs are much more compressed than print streams. For some printers the print size is almost constant (a huge bitmap), for others, it's a collection of graphical items and the size varies enormously. Rarely anything you can do.

  • I am using acrobat 9 pro. Using the optimise pdf. File size increases?

    I am trying to clean up some previously scanned images containing mainly text. The original file sizes are 80K. I use the optimise pdf tool to 'despeckle' with all the other option set to off. When I save and then check the new file size it has increased threefold. Any ideas as to what I am doing wrong?

    This is the Adobe Contribute forum. Acrobat forums are at http://forums.adobe.com/community/acrobat.
    That being said, have you done a "save as" on the files?

  • File size increase after installing LCD ES v8.2.1 (CS3.3)

    Hi,<br /><br />Problem:<br />The file size of a LCD v8.0 form increases significantly when opened + saved in LiveCycle Designer ES v8.2.1.<br /><br />A Dynamic XML form, targeted at Reader 7 & up, build in LiveCycle Designer 8.0.?, has a file size of 75 kB.<br /><br />Our company has upgraded to Creative Suite 3.3, which is shipped with Acrobat Pro 9.0, and, apparently, LiveCycle Designer ES v8.2.1.<br />The installation removes the previous version of LCD.<br /><br />If I just open and save the form in this new LCD, the file size becomes 473 kB.<br />The XML-tab shows some additional rows, in the <config> part, but not enough for 400kB of extra code.<br /><br />Further specs:<br />- Windows XP Pro SP3, fully patched;<br />- Creative Suite 3.3, updated.<br /><br />Anyone a solution, work-around, some info?

    SOLVED!
    Don't embed fonts...
    I was too hasty.
    (did'nt even know you could embed the fonts in LCD)

  • HT1338 Why isn't the file size displayed for software updates in the App Store?

    Why isn't the file size displayed for software updates in the App Store?
    My only internet connection is a tether to my iPhone.
    My limited bandwidth forces me to manage my data consumption - I am forced to "google" the file size of the software update so I can decide if I have the headroom in my data plan to take advantage of the update.

    If you click on the name of the Application in your Updates Available list,
    it will take you to the update Imformation for that App.

  • Folio article file size increases massively with more buttons

    Hello,
    we are about to finish up a DPS project and now have some serious problems with the folio sizes.
    We did all the usual things to make folios smaller (cropped every image to the trimmed size, pdf articles, vektor overlays etc.)
    So we made some tests and discovered a really strange behavior:
    We have one single article with a fullscreen MSO containing 7 picture status, and seven buttons (with the same pictures as thumbnails) that lead to the appropriate statuses.
    First we tried to experiment deleting images from the MSO but this had no effect on the file size. But as we deleted the seven buttons the file size changed from 10MB to 52MB!
    The size of all the assets (images and ID file) from this article is only 12 MB.
    Is this a known bug? Is there a way around it? It is some kind of crazy when an uploaded folio has 4 times the size as all his assets?!?!
    Thanks in advance,
    nils

    Hi Bob,
    sorry for my late reply.
    I have done some additional testing and came to the conclusion that no button is responsible for the big file sizes.
    It was the overlay setting after all (sorry for pointing in the wrong direction). As I switched the slideshow from "Raster" to "Vector" the file size decreased plenty. (I thougt I checked this but actually I did it only in vertical articles.)
    However I did not know that the export format has such an impact on file size. This one article decreased from 52 MB to 17 MB. And it was only one slideshow with 7 (retina) images inside.
    Changing all the slideshows in our 50 article folio (about 35) decreased the file size from 576 MB to 243 MB!
    Thanks,
    nils

  • SQL LOG FILE SIZE INCREASING

    Hi DBA's
    SQL Log file size occupies more disk space on the server, the overall database size is 8GB
    How to decrease the SQL LDF file size on the server, please explain the suitable steps to perform
    Thanks
    DBA

    use master
    go
    dump transaction <YourDBName>
    with no_log
    go
    use <YourDBName>
    go
    DBCC SHRINKFILE (<YourDBNameLogFileName>,
    100) -- where 100 is the size you may want to shrink it to in MB, change it to your needs
    go
    -- then you can call to check that all went fine
    dbcc checkdb(<YourDBName>)
    Andy ,
    what point in asking user to use No_log and you did not even motioned about what this eveil command will do. Actually its
    seriously not required reason being initial size of log file set to 8 G.
    Plus what is point in running checkdb ?
    I don't agree to any part you pointed
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it
    My Technet Wiki Article
    MVP

  • How can I keep the file size small when I render a .mov file to video in PS entended CS4?

    Hi,
    I haven't worked with video in Photoshop before and I am having the following issue:
    I imported a .mov file into photoshop. I trimmed the file by moving the start and finish points to the relevant points on the timeline. I then cropped the image to get rid of unwanted footage on the edge of the screen. I then selected export - render video. On the panel I chose to select only "currently selected frames" as the range and I chose "Quick Time Movie" as the file type. When I check the properties of my newly rendered movie the file size has increased by several times. The file sizes are now much too large.
    I know that I must need to alter some of the render settings but having tried altering many of the settings the result is always the same - a very large file size that is much bigger than my oringinal file.
    If anyone can let me know how I can carry out a simple crop & trim on a .mov file and end up with a smaller more compact file after rendering the video I would really appreciate it. Thanks in advance!

    Hi Marion,
    Thanks very much for your message. I have downloaded that program and it's definitely handy for examining the details of the original file. You mentioned in your message about not having to recode the file - The file I'm editing is originally from a Q3 Zoom video recorder and I can use their in-built software (handyware) to trim the file - this doesn't recode the file and so the file size just reduces by the required amount. Unfortunately there is no facility to crop the file with this software - I've looked for other software that would allow cropping without having to recode the file but I haven't found anything suitable for a simple procudure like this - do you know of any software that allows you to crop a file without recoding? Thanks.

  • How to write content of the file under folder

    Hi Experts,
    I have following scenario, I have list of files under folder in local desktop(for eg D:\mani)
    I have only filename, using this filename i want to search and get content of the particular file and write in some other location? how to do that? give your suggestions?
    Regards,
    P.Manivannan

    You could go two ways here:
    The first possibility requires that (a) you know what operating system you are working with, and (b) you only need to copy the file, and not do anything else with the contents of it. In this case, probably the easiest way to do this is to use a Runtime exec command for the file you want to copy:
    java.lang.Runtime.getRuntime().exec( "cp D:\mani D:\mani2" );Otherwise, if you need your code to be portable, you can't assume anything about the operating system. Since java.io.File doesn't provide a copy method, you will need to read the entire contents of the file into the vm, and then write them out to a new file. Also, if you need to use the contents of your file in some other way, as well, then you also need to read the entire contents into the vm. In this second case, how you read the file may depend on what kind of data the file contains.
    In general, the following code should work for you:
    final FileInputSteam  fis = new FileInputStream ( new File( "D:\mani"  ) );
    final FileOutputStream fos = new FileOutputStream( new File( "D:\mani2" ) );
    final byte [] buf = new byte[ 1024 ];
    int bytesRead;
    while ( ( bytesRead = fis.read( buf ) ) != 0 )
        fos.write( buf, 0, bytesRead );Don't forget to catch or throw IOException.
    Hope this helps.
    - Adam

  • Is there a way in an unstructered Frame11.0 file to change all anchored frames in the file to a specific size at the same time?

    Is there a way in an unstructered Frame11.0 file to change all anchored frames in the file to a specific size at the same time?

    Rog,
    This is perfect use case for ExtendScript. You could easily iterate over all anchored frames and resize them. You would probably want to resize the contents as well, though, which would add a few extra lines of code.
    Russ

Maybe you are looking for

  • Usando GRC NFe com Outro Middleware (TIBCO)

    Pessoal, Estamos instalando o GRC NFe em uma empresa e por questões de segurança o PI não pode "sair" para internet. Assim, ao invés de me comunicar com o SEFAZ, estou comunicando com o TIBCO (este é o nome do software). Acordamos que o TIBCO teria q

  • Mini Displayport to Dual-Link DVI Issues on 30" Cinema Display

    I know this problem has been around for a while, and that there are several other discussion on it, but my goal here is to point out that even in mid-2011, this issue remains. Here's my configuration: 30" Cinema Display Dual-link MDP to DVI adapter w

  • Ipod Nano sync songs but when play song it stops

    HI, When I listen to the song in Itunes the whole song plays well. Once I sync the nano the same song plays for a few seconds and stops. Can anyone help me with this? What can I do to fix it?

  • Report not loading on entering page the first time

    Hi I use a collection to generate a cross tab style report. The report shows records using a week's date range. The date range can be changed by using a previous and next button. When opening up this page the date range defaults to that current week

  • Photo effects in Garageband

    Is there a way to dissolve between photos in a Garageband podcast? Or is a cut between photos the only way to show the photos? I'm matching photos to a pre-recorded narration and can't create a slideshow first.