Help: file sizes

hi all can someone help me?? im an trying to get the size of i file.. i can do it but wat currently if the file size is large then it takes a long time to get it.. i am currently doing it this way...
try{
FileChannel fc = (new FileInputStream(getAbsolutePath())).getChannel();
size = fc.size()/1000;
}catch(Exception e){}
is there a faster way to do it??

yes it dus thanx so much.. man i dont no y i didnt see that in the first place :p i must be blind

Similar Messages

  • Urgent Please Help::File size reduced after Dom Parsing

    CODE
    public class Domtest {
    public static void main(String[] args) {
         String resDir = "c:\\res\\";
         Document doc = null;
         try{
         File docFileIn =new File("c:\\test\\test3.jdf");
         DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
         dbf.setIgnoringElementContentWhitespace(true);
         DocumentBuilder db = dbf.newDocumentBuilder();
         doc = db.parse(docFileIn);
         TransformerFactory transformerFactory = TransformerFactory.newInstance();
         Transformer transformer = transformerFactory.newTransformer();
         transformer.transform( new DOMSource(doc ),
         new StreamResult( new FileOutputStream(
         resDir+"response123.jdf") ) );
         catch(Exception e){}
    1.file3.jdf is 35 kb
    2.response123.jdf is 32 kb
    File size is reduced .
    thanks in advance.

    Thanks very much
    That was the reason .
    I have noticed many white spaces in the file and ignore white spaces worked.

  • Reduce file size #3...croping masked photos, how?

    Questions on reducing a pages to pdf file…I will post each question seperatly.
    3) I have used mask in pages on photos extensively. It would certainly help file size to crop the unseen portion. Is there a way to do this automatically (even a utility with a cost would be OK)?
    If not, what is the best way to do it manually? I have iphoto and adobe photoshop elements, but the idea of opening each one individually does not sound fun.
    Thanks bob

    Pages will not actually crop the image. It will mask it but the masked part still is in the file.
    There are a large number of utilities that will batch process images to fixed sizes and resolutions. The problem is that none of them know how to crop to an aesthetic decision, that is for you to decide.
    Search at http://www.macupdate.com
    If you need to manipulate images:
    http://www.freeforum101.com/iworktipsntrick/viewtopic.php?t=80&mforum=iworktipsn trick
    Many image editors allow you to set the proportions of the crop and the resultant resolution, which helps to speed up the work if you have set sizes in Pages.
    Peter

  • I need to export a photo at around 1meg file size,and dont seem to be able to do it in the presets can anyone help please ,I shoot on a canon 5d

    I need to export a photo at around 1meg file size,and dont seem to be able to do it in the presets can anyone help please ,I shoot on a canon 5d

    I believe Frank is referring to the end use (e.g., for print or on-screen use).
    Until he returns, I can tell you that I ran a quick test using an image from the Aperture 3 training book library which was as follows:
    Camera = Canon EOS 5D Mark II
    Master resolution = 5616 x 3744 (21 MP)
    I was able to export to a JPEG with end file size of 1 MB as follows:
    Export Presets drop-down > select 'Edit' option
    Selected preset name 'JPEG - 50% of Original Size' > change percentage value to 40% > change DPI value to '300' > click OK to set as current default > Export version to desktop.
    The exported JPEG has a resolution of 2246 x 1498 and appears on screen to have the same image quality of the original in Aperture.
    Note - I did not change the default Image Quality slider in the Export Preset dialog (which left it at 10).
    Basically, you will need to play around with the settings until you find the appropriate values to arrive at an image version you want.

  • Adobe Media Encoder - File Size HUGE. HELP

    I have a MPG that is 216mb. When I attempt to use Media Encoder 5 or 5.5 the estimated file size for a 640 x 480 f4v is 26456mb.
    I have used the computer at my school with the same file and the file size is 2mb. What am I doing wrong at home? I can't image encoder can make a 216mb file become 2.6 gb.
    Please help.
    Howard

    Please drop the source clip into MediaInfo and check what it says the duration is. (If you don't have MediaInfo, you can download it for free from the Internet.) If possible, please post a link to the clip so that we can download it and check it out for ourselves.
    Two details catch my eye in the Source Summary. Both screenshots show that the field order is Unknown and that the clip has no audio. I doubt either of those details accounts for the incorrect duration, but the unknown field order, at least, makes me wonder whether AME is having trouble interpretting the footage correctly. I suggest going to the Interpret Footage dialog (right-click on the clip in AME's queue and select Interpret Footage), and setting the Field Order to the correct value [Upper Field First, Lower Field First, or No Fields (Progressive Scan)]. While you're there, check whether the frame rate is accurate--according to the screenshot, it's 30.000 fps. Is that accurate?

  • Help me reduce VHD file size when deleting data in OS.

    I use Hyper-V on Server 2008 64bit installation to create a CentOS 5.8 VPS has the capacity 100GB. After a period of use of disk space used up nearly all 100GB. I have deleted a VPS data in this section but I checked VHD file size not reduced. 
    The way you can help me do this? I thank

    Well if it was a Dynamic VHD(x) to begin with, you have just expanded it out to its maximum.  In order to reduce its size, which is different that actually shrinking the partition and VHD(x) structure, here is what you can do.  
    If this was a Windows box I would have tell you to defrag inside the VM, shut it down and then use the tool from within Hyper-V Manager to Compact the VHD(x) file.
    You could try the Compact against the your CentOS VM and see how much it does decrease the VHD(x) drive.  
    Without a good ext3 file reorg utility out there, you may not get down to the smallest possible size.  You could always backup the VHD(x) file and restore it to another VHD(x) and swap the drives out.  This laying down of the files from backup
    would make them contiguous again and reduce your over all size of the VHD(x) file. That seems like a lot of work, but would meet your goal.  I would try the Compact option first with the VM off to see what gets reclaimed.
    Rob McShinsky (www.VirtuallyAware.com)
    VirtuallyAware - Experiences in a Virtual World (Microsoft MVP - Virtual Machine)

  • I need to compress an InDesign file to web-quality pdf but file size is still too big. Help!

    I need to compress an InDesign file to web-quality pdf but file size is still too big. Help!

    Hi Bill,
    It sounds like your document has a lot of pages and/or images in it.
    Instead of using the normal InDesign > Export command to create a PDF, you may be able to reduce the file size by printing to a PostScript file, then distilling it to PDF using Acrobat Distiller.

  • Need help shrinking iPhone video file sizes.

    Thanks in advance, folks!
    I just recently bought an iPhone 4 and I love it. The only is, despite the phone recording in HD, the file sizes are huge. Even using the SD vga camera in the front, 2 and a half minutes equals 45MB.
    Is there anything I can do in iTunes, or the phone itself to change the quality and reduce the file size? If not, is there a program I can use to do this?
    I have searched all over the internet and haven't found any info. I really hope you guys can help me out. Again, thanks!

    Pls change the file extension to the format in which the file was recorded for eg : .mp4, .3gp, .avi. Check first in which format ur phone records a video file and apply a similar extension do dat fill, revert if any query.

  • Export file size help...output seems way too big

    I have a 12 minute movie with audio, video and stills in it.
    Currently when I export it the file is 865MB...  I need it to be less than 100 with decent quality.  It is a tutorial video that will be downloaded from the web.
    Can you please give me some direction on how to do this?  On what variables to change etc.  I know if I exported this out of Camtasia Studio, it would be around that 100 or less bench mark .... problem is I don't know what the settings for the Camtasia preset are.
    I am using the following setup:
    Quicktime Format
    Summary:
    Output:
    1400x790, 15(fps), quality 100
    48000 Hz, Stero, 16 bit
    H.264
    Source:
    Sequece, 01-OverviewSWKit
    1920x1080 (1.0), 24fps, Progressive, 00:12:03:12
    48000 Hz, Stereo
    Settings:
    Video Codec:  H264
    Basica Settings:
    Quality 100
    Width/height (1400 x 790
    Aspect: Square pixels (1.0)
    Render at maximum depth - "UN"-checked
    Depth: 24 bit
    Advanced Settings
    Key Frame every 1 frame - "UN" checked
    Optimize stills - "UN" checked
    Frame Reordering "UN" checked
    Bitrate setting:
    Limit data rate to xxxx  "UN" checked
    Use Maximum Render Quality - "UN" Checked
    Use Previews "UN" Checked
    Use Frame Blending "CHECKED"

    Well, with the Apple H.264 encoder in a QuickTime container, you're a bit limited to the number of things you can tweak to decrease final file size. Using a more advanced H.264 encoder, like the free x264, will give access to many of the more "high-tech" bells and whistles that are part of the H.264 standard. One potential would be to tick the "Key frame every # frame" box and try a few values there, usually at multiples of your frame rate. Key frames are "whole" frames that take up much more space in the final file size, and decrease their frequency might help slightly decrease file size, though it will also affect quality.
    Short of changing the dimensions of your destination video, decreasing the frame rate, or changing the bitrate of the video and audio streams, you will eventually reach a limit of how much you can push one parameter or another. You might try using H.264 in the Format (not codec) dropdown; this will give you a bit more control over encoding to an H.264 MP4 file. Unless you specifically need a QuickTime MOV, you might find you get better results with the H.264 MP4.
    These are of course just the options in Premiere itself. Once you go outside the castle walls, you can find a whole bunch of other options, though they usually come at a steeper learning curve. The big thing to remember is that there is no free lunch when it comes to encoding; you have to give a bit here to gain there, and it's all about setting thresholds of what you're willing to accept.

  • Crazy File Sizes - Help!

    Hello,
    I have a multi-part question about multi-page PDFs.  Two things are happening to me quite a lot with Acrobat and PDF creation, and I need some help figuring out what's going on.
    Thing 1:
    I will receive a bunch of scanned music, each page scanned separately as a separate PDF ... and each one sent in its own separate email, resulting in 30-40 emails at a time ... from another user.  Each PDF page that gets sent to me tends to be somewhere around 500K.  My task is to use Acrobat to combine the incoming scans into a multi-page PDF.  The actual creation of the multi-part PDF is no problem.  Getting Started > Combine Files into PDF is a straightforward move, and that's what I do.  But the resulting multi-page PDF is HUGE.  I've tried optimizing, I've tried saving it as a Small PDF ... neither of those things do much at all.  I'm seeing file sizes around 5,000K by the time I'm done with an average-sized multi-page instrumental part (about 5-6 pages of music). 
    A big file size isn't necessarily a big deal, but I have to distribute these multi-pagers via email (that is the only electronic format that doesn't feel like alien technology to the people on the distribution list) and sending these big files in emails tends to be problematic.  Slow downloads, file size limits exceeded, etc. ... this big file size thing is really annoying. 
    I suspect the massive file size is caused by how the initial user scanned in the pages of music, but I can't control what the initial user does; I just have to work with what arrives.  Is there any way that I can fix this?
    Thing 2:
    I noticed that when I used the basic set-up at Fedex/Kinkos and, using a scanner and Acrobat, scanned 8.5 x 11 copies of some music as a black and white document, combining my scans into one PDF as I went and optimizing them, a file that would have been around 6,000 K coming from the other initial user and being paged together by me ended up being 568 K using this method.
    When I used my camera as a impromptu scanner and used the CamScan application to take a picture of a document and save it as a PDF, I was getting pretty ridiculous file sizes, 400-500 K a page.  Sam issue as with the PDFs coming from the initial user.
    What is going on?  Is there something in the scanning method that affects how big the file is?  Is a flatbed scanner and Acrobat the only way to get small PDF sizes?
    Thanks for any help you can provide...

    yes it dus thanx so much.. man i dont no y i didnt see that in the first place :p i must be blind

  • Help with compress function--file sizes not substantially reduced

    I've tried to use the compress function (right click "compress" or Finder/File/Compress) a few times on files from a variety of different programs. While this results in creating a zip file, the file size is not substantially reduced (e.g., from 43.4 MB to 42.9 MB). Is there a way to change how much a file is compressed?
    Thanks in advance for your help.
    Eric

    Not all material is very compressible. Text files and word processor documents usually compress very well. Photos and movies don't compress much if at all due to the nature of their structure (in some cases, using a general-purpose compressor can actually make a file larger). So it will depend on what it is you're compressing.

  • Need help reducing file size.

    We're using Acrobat 8 Standard and are able to reduce an 8 MB file down to 7 MB but a fellow employee with Acrobat 9 Pro was able to reduce the size of the same file to 1.8 MB. We're doing the same function (Reduce File Size) in both apps so we're not sure why there's such a big difference in finished file sizes between the two programs. Is there a setting in Acrobat 8 Stnd that we're missing to be able to drop the file size much closer to what Acrobat 9 Pro can achieve?
    Any help would be greatly appreciated.
    Thank you!

    There are a lot of factors that can affect file size. PDF Optimize allows you more control over those options that does the Reduce File Size. With PDF Optimize, you can do an audit of the PDF to see what is taking up a lot of the size. Things that can affect the size include:
    1. Image resolution (PDF Optimize can reduce)
    2. Embedded fonts (subset fonts recommended to reduce size - leaving the fonts out is not a good idea)
    - Other?
    That may help some. When you compare how different machines or versions of Acrobat do the file reduction, you need to simply review all of the options that are being used. Sometimes, you can get a reduction by reprinting to a new PDF, but that is not a perfect process either.

  • Help!..CS4 IS INCREASING FILE SIZES.

    Hi all
    Wondered if anyone has had a problem with increased files sizes when opening a document up in Photoshop? Anything i open up is increased by two thirds  in file size and i've no idea why ( e.g..8MB doc opens as 24MB doc)
    What is even more strange is that it won't let me reduce a  file size to anything under 1MB.
    Has anyone ever come across this problem?...would appreciate any help.
    Thanks
    Bri

    Hey Noel
    Fair Play.
    This is what is happening.
    I’ve got a standard JPEG file that viewed in Explorer and Bridge reads as a 2.70MB (2838,796 bytes) file. Pixel dimensions 797x1000. Document size  6.75 x 8.47cm .Res 300 PPI.
    When I open it in CS4 it reads 2.28MB. (This is the first thing I don’t understand)
    Either way my simple( so I thought ) objective is to decrease the file size.
    In the image size box I have re-set the resolution to 72ppi as I just need to post the image on a Website. My before and after calculations in the image Panel reads (was 2.28MB...now 134.3k)
    Great! .this is what I want, However..... when I ‘save as’ and the JPEG compression box appears it has suddenly increased the file to 1.8MB Large file...and only allows me to reduce it to 1.7MB small file.
    Admittedly this is not my area of expertise....I’m doing something wrong so any pointers would be much appreciated.
    Bri

  • Aperture help/questions - File Size, Versions, etc

    Hi,
    I am new to the Mac, and after a small learning curve am now loving it. Can’t believe what I missed all those years under Windows. Anyway one of my biggest problems has been workflow and photo management, so I rushed out and bought Aperture without much investigation. I’m still getting to know it, and so far think it’s very good except for the following points, which may be down to my inexperience with the product rather than any shortcomings. I store all my shots as managed files in my Aperture library.
    1. File sizes. Often I use Photoshop for minor/major modifications. There would be few shots that would not require some tweaking if I wanted to get the best image. I have PS3 set up as my external editor. My problem is the huge file size generated after using PS. For example my master file may be around 3mb (jpeg) but my PS file is 45mb! Now if I have a few versions of the PS file, as often is the case, I go from a few megabytes of storage for the image to a few hundred megabytes of storage!! Is there a way around this ??
    What’s more if I create a Duplicate Version of the PSD version and do NOTHING it grows again. For example my initial JPEG is 2.78mb, I creat a new version via PS and add some adjustment layers and save the new version back. This new version has now grown to 45.56mb. I then wish to make another different version based on my previous version so I first select the version1 and then Duplicate Version. Now before I do ANYTHING if I save it back I get a new version with a file size of 68.49mb!!! If I do this again, my next version is hasn’t grown in size again, it’s still 68.49mb. What gives ??
    2. Per 1) above can I save back from PS in JPEG and not PSD to bring the file size down. That is open the file in PS via the external editor in Aperture, make some adjustments and save it back as a new version in JPEG ??
    3. Related to 2) above I often want to have multiple PS versions. For example the first one may just have some USM added. Subsequent ones however may have different crops, tonings, etc. So in Aperture what I do is create my first version and add the USM and whatever other standard treatments. Then save this. Then create a duplicate of this version and open the duplicate in PS via the external editor in Aperture. Make some changes then save back. Only now I have 4 files – the original, my version 1, the duplicate of this and my new version based on the duplicate. So I must now delete the duplicate (file three) version . Is there a better way ??
    4. I find it hard sometimes to tell if I am on a master file or a version. Is there a way to definitely tell ? For example on occasion I have gone to delete a version, I get the dialog warning that all versions and masters will be deleted and then I seem to have lost both the version AND the master ?? This seems a bit dangerous.
    5. The vault seems very slow to update when minor changes have been made. For example I created a new version of a master with a minor modification performed in Aperture (saturation set to zero) and then updated my vault. This should be a very quick process as the new version really just consists of some modification information and not the whole file. The update takes as long as if I were to add a few hundred megs of new photo’s to the library ! Is it overwriting the whole vault again, or is it just updating the changes (as I assume it should)
    Sorry for the long winded explanations. Any advice/help/thoughts are much appreciated.
    Thanks.
    Simon
    imac24   Mac OS X (10.4.8)  

    Hello, Simon
    quote: "I am new to the Mac, and after a small learning curve am now loving it."
    It only gets better
    Welcome to the forum and macs!
    quote: "My problem is the huge file size generated after using PS. For example my master file may be around 3mb (jpeg) but my PS file is 45mb! Now if I have a few versions of the PS file"
    Check your Export Image settings like quality, size, DPI. Prior to Open with External Editor make the photograph as best as possible, all adjustments, crop, etc and then take it to Photoshop, back to Aperture and print it or upload to web etc. If the photograph is being used on the web there is no need to make a huge file
    quote: "above can I save back from PS in JPEG and not PSD to bring the file size down"
    You might think about keeping the jpegs jpeg on the export from Aperture to PS instead of jpeg to psd to jpeg.
    4. quote: "I find it hard sometimes to tell if I am on a master file or a version. Is there a way to definitely tell ?"
    the "m" key toggles from Master to Version (adjusted).
    5. quote: "The vault seems very slow to update when minor changes have been made."
    this is contingent on the system like rpms, processor, usb or fw...
    victor

  • Can the font size in Itunes Help files be increased? The font size is way to small to... 4pt!

    Itumes for Windows 10.6
    Windows 7 x 64
    Is there a way to increase the font size displayed in the Itunes Help files? The size seems to be < 4pt and very difficult to read. Please advise.

    Sometimes this can be altered by going inside the "plist" for the project and making specific changes. It is beyond my scope, but someone on these forums should be talented enough to suss it out.

Maybe you are looking for

  • To find out files to be recompiled

    Hi All, Suppose I have hundreds of source files in a number of packages. Suppose some file in a package has changed. How do I find out which of the classes in the whole project have to be recompiled ? I do not want to do an entire rebuild. * Is there

  • Error when upgrading from 8.1.3.0 domain to 9.2.0.0 domain

    I am running the upgrade.sh found in the WLS92/common/bin directory and all goes well until I get this... <Dec 13, 2006 10:54:00 AM EST> <INFO> <Upgrade> <BEA-800000> <Starting in-memory configuration upgrade ... > java.lang.NullPointerException at w

  • How do I install OS X on my MB Pro with a new HD

    I had to replace Hd and now do a fresh install of OS X, Holding down the C key does not work, what is the correct key combo to boot from the Optical drivce with OS X

  • Enabling EAX tm for Sound Blaster ZS under windows 7

    My sound card used to have EAX support under windows xp 32-bit, thus I could enjoy that choice of noise within video games. Now the options in video games tell me that I don't have that EAX capability. I'm rocking windows 7 32-bit and don't know what

  • Problem in Workitem ID - Number Range:

    Problem in Workitem ID - Number Range: Hi experts: I am having a new issue, the range of workitem change. I was using the workitem 14933115 and then started in 407013. About this change of Idu2019s Iu2019m having a lot of issues, Are any way to comeb