I need a help in reading video file of 80MB into ...

Hello,
I need a help in reading video file of 80MB into a vector storing ByteArrays in it.Please help me soon.
Thank You

Hello,
I was able to solve my problem by thinking & my code goes as follows.I am trying to read a video file in my program.
public Vector getFileMediaContent(RandomAccessFile fileObj){
     Runtime runtime = Runtime.getRuntime();
System.out.println ("Free memory : inside Boolean Type Panel" + runtime.freeMemory() );
dataContent.removeAllElements();
System.out.println("dataContent :"+dataContent.size());
try{
int size=(int)fileObj.length();
if(size<2000000){
byte[] data = new byte[size];
fileObj.read(data);
dataContent.addElement(data);
data=null;
System.gc();
else{
int fixedsize=2000000;
int startindex=0;
int read=0;
int remaining=0;
while(read!=-1){
byte[] data=new byte[fixedsize];
read=fileObj.read(data,0,data.length);
dataContent.addElement(data);
startindex=startindex+data.length;
remaining=size-startindex;
fileObj.seek(startindex);
data=null;
System.gc();
if(remaining>0 && remaining<2000000){
byte[] data1=new byte[remaining];
read=fileObj.read(data1,0,data1.length);
dataContent.addElement(data1);
data1=null;
System.gc();
System.out.println("outside while");
System.out.println("dataContent 1 :"+dataContent.size());
System.out.println ("Free memory : inside Boolean Type Panel" + runtime.freeMemory() );
fileObj = null;
System.gc();
}catch(Exception e){
e.printStackTrace();
return dataContent;
Now I am not facing the problem of IndexOut of Bounds Exception But I am getting Out of Memory Error.
Can You suggest me to come out of this,.
As I know I have two solutions.
1.Make the objects Null which is using more space & call System.gc();
2.Increase the Virtual Memory of my System.
Any solutions other than this?
And How to Increase the Virtual Memory?Please do reply.
ThankYou

Similar Messages

  • Ipod too slow when reading video files via DVD player with USB port.

    Hi all, this is my first message in this forum.
    I've got a DVD player that has a USB port and reads all types of disks. When I use my IPOD 80 GB the files I read are somehow frozen and don't run properly (lack of sync between audio and video, etc). I've got version 1.2.1 and use it in disk mode otherwise the player doesn’t see it. Meanwhile a friend of mine uses it's 60 Gb IPO on the same player, version 1.0 and it doesn't need to go to disk mode, and the player reads perfect from it. Is this a problem of the ipod software version?
    Both ipods are in Fat32 format, but in his ipod the partition is set to active. I can't change mine to that, because windows is seeing my IPOD as a removable device, and my friend’s IPOD as a disk.
    Hope I haven't been too confusing, and I welcome any help anyone can give.
    Thanks.

    Sorry, but I don't even know
    what it is you are trying to do. Are you attaching
    the iPod to a stand alone DVD player? Are you trying
    to export stuff out of the iPod into the DVD player?
    Patrick
    Hi, I'm attaching the iPod to a stand alone DVD player, that has a usb input port. And then read video files from it.

  • Need some help in saving video message from viber to my Iphone. I disabled the thing that would save photos and videos automatically then, there comes a video I want to save. After loading and watching it, I press the "save to gallery"

    Need some help in saving video message from viber to my Iphone 5S with new ios 8's program . I disabled the thing that would save photos and videos automatically then, there comes a video I want to save. After loading and watching it, I press the "save to gallery" thing but it doesn't save in gallery. I tried all, restarting my phone, rebooting then turning on the save automatically thing and when I watch it again, it still wouldn't save.

    Probably a good question to ask Viber or look at their support site.

  • I have a problem with the mac can not read video files with the extension IMOD. How can I solve this problem?

    I have a problem with the mac can not read video files with the extension IMOD. How can I solve this problem?

    By doing a Google search. 

  • HT204382 What program do i need to play .MKV (matroska video) files?

    What program do i need to play .MKV (matroska video) files?

    To see them, I recommend VLC. It doesn't transfer videos, but you can see it

  • 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.

  • Need help with reading a file

    Hello, I'm trying to read this file, but I keep getting a java.nullpointerexception at the end of it:
    Element: PART
    Content: (HEADER,CHAPTER+)
    Element: p
    Content: (#PCDATA)
    Element: INTRODUCTION
    Content: (HEADER,p+)+
    Element: CHAPTER_NUMBER
    Content: (#PCDATA)
    Element: HEADER
    Content: (#PCDATA)
    Element: BOOK
    Content: (OPENER,SUBTITLE?,INTRODUCTION?,(SECTION|PART)+)
    Element: SECTION
    Content: (HEADER,p+)
    Element: CHAPTER
    Content: (CHAPTER_NUMBER,CHAPTER_TEXT)
    Element: OPENER
    Content: (TITLE_TEXT)*
    Element: CHAPTER_TEXT
    Content: (p)+
    Element: SUBTITLE
    Content: (#PCDATA)
    Element: TITLE_TEXT
    Content: (#PCDATA)
    here is my code:
                           s = br.readLine();
                            while (s != null){
                                    node[i] = new Node();
                                    if (s.startsWith("Element: ")){
                                       node.element = s.substring(s.indexOf(":") + 2);
    System.out.println("Element[" + i + "]: " + node[i].element);
    else if (s.startsWith(" Content: ")){  
    node[i].content = s.substring(s.indexOf(":") + 2);
    System.out.println("Content[" + i + "]: " + node[i].content);
    s = br.readLine();
    if (s.startsWith("Element: ")) i++; //line 194 causes error
    br.close();
    here is my output
    Element[0]: PART
    Content[0]: (HEADER,CHAPTER+)
    Element[1]: p
    Content[1]: (#PCDATA)
    Element[2]: INTRODUCTION
    Content[2]: (HEADER,p+)+
    Element[3]: CHAPTER_NUMBER
    Content[3]: (#PCDATA)
    Element[4]: HEADER
    Content[4]: (#PCDATA)
    Element[5]: BOOK
    Content[5]: (OPENER,SUBTITLE?,INTRODUCTION?,(SECTION|PART)+)
    Element[6]: SECTION
    Content[6]: (HEADER,p+)
    Element[7]: CHAPTER
    Content[7]: (CHAPTER_NUMBER,CHAPTER_TEXT)
    Element[8]: OPENER
    Content[8]: (TITLE_TEXT)*
    Element[9]: CHAPTER_TEXT
    Content[9]: (p)+
    Element[10]: SUBTITLE
    Content[10]: (#PCDATA)
    Element[11]: TITLE_TEXT
    Content[11]: (#PCDATA)
    java.lang.NullPointerException
    at Test.readDTDObjectFile(Test.java:194)
    at Test.<init>(Test.java:143)
    at Test.main(Test.java:338)
    can anybody help me figure out how to fix this? thanks so much!

    nevermind, i figured it out. thanks anyway!

  • HELP! recorded video file seems corrupted, need guidance

    Last weekend i recorded a lengthy video file from my friend's birthday party. As it turns out, near the end of the party the recording errored out and the video file that it had been creating for hours became unreadable. We have tried many different avi file fixers on it but none have had any luck. I cannot play this file in any of my video applications, nor can i open it in an application such as Sony Vegas.
    Is there any hope for recovering the footage in this avi file? It was recorded using the creative software provided with the Creative Live! Optia camera (this is the camera we used to record the footage).
    Thanks for any help!

    Welcome to the Apple Discussions.
    Might be best to post that one on the iMovie forum here
    http://discussions.apple.com/category.jspa?categoryID=141
    This is the iPhoto forum.
    Regards
    TD

  • Need program to fix corrupted video files

    Hello,
    This my first mac and I was wondering if anyone knew of a program that could help me with the following problem...
    I am trying to import videos from my Canon FS100 camcorder (videos are saved on an SD card) and when I plug in the camera to the USB port it can only import one of 9 photos and none of the video. I received a message stating that the files were in an unrecognizable format. I have used the camera and the same brand SD card before and had no trouble importing photo and videos. After about an hour on the phone with APPLE help services last night, the support person concluded that the SD card files had probably been corrupted. Is there a program I can use to fix the files so I can import them to iphoto? I know that the SD card needs to be reformatted before future use but was hoping to be able to use the videos in iphoto and imovie. The file extension of the video file is .MOI or .MOD. I have tried importing directly from the SD card as well but receive the same messages. When I try to import the video clips into imovie, imovie shuts down.
    Thank you for any help!

    nicoler82 wrote:
    .. unfortunately the pictures and some of the videos are no longer visible using the camcorder. I guess the SD card has been corrupted or damaged. Is there anything I can do to restore the images or do I just cut my losses?
    oo-ohh.. no happy end..
    I once helped a friend, who's snapshot-cam erased his precious photos by itself with this tool:
    http://www.bluem.net/en/mac/exif-untrasher/
    .. BUT this is for stills..
    honestly, no idea, about 'movie recovery' aside the 'usual suspects' for data-recovery..
    type 'recovery' as search-item at www.versiontracker.com..
    I heard of a tool named *Test Disk* & PhotoRec.. free, and some people are very happy & grateful with it
    http://www.cgsecurity.org/
    just to feed my curiosity: what brand was the sd-card? and what price?

  • Need urgent help with creating .war file ...

    My boss gave me one day to create an app. that runs on Apache Tomcat 4.0.6. I managed to get it done, but now I'm trying to move it from my machine to the web server. Each time I try to create a .war file I get an error saying "no such file or directory". Am I missing a step here??
    What I do is: go to the webapps/<appname> directory where the app. is located, type in jar cvf * path/to/application/appname.war.
    I then get the "no such file..." message, then a message that says "added manifest" then lines on the screen that say adding: blah blah file. It goes through all the files in my app directory but I get no resulting .war file.
    I'm so frustrated and confused at this point, any help would be greatly appreciated.

    >
    What I do is: go to the webapps/<appname> directory
    where the app. is located, type in jar cvf *
    path/to/application/appname.war. No need to create an intermediate zip file, or to use JDeveloper to create a simple war file.
    You just need to put the WAR name before the list of files.
    jar cvf appName.war *

  • I need a help to generate new file

    Hi Guys
    I need your help. I have two text box in my form, the first one takes the file name to read, and then when user type in another file name in the second textbox, result should be saved as a typed file name in the same path.
    What I really want to do is, when the file is exist already (for instance, I'll name it as result.txt), my program scan through the result.txt file and append the new data at the end of the file. But result.txt file doesn't exist, it has to generate new file and save the data into the new one. I think I need to implement these in the OpenFile1() function, but I dont' know how.
    Does anybody have idea to solve this?
    private void saveFile() {
    textArea.append("SAVE FILE\n---------\n");
    if (openFile1())
         try {
              outputToFile();
    catch (IOException ioException) {
              JOptionPane.showMessageDialog(this,"Error Writing to File",
                   "Error",JOptionPane.ERROR_MESSAGE);
    private boolean openFile1 ()
         // Display file dialog box
    title=textfield1.getext();
    path=fileName_in.getPath();
         File file_out = new File(path, title);
    if (fileName_out == null || fileName_out.getName().equals("")) {
         JOptionPane.showMessageDialog(this,"Invalid File name",
                   "Invalid File nmae",JOptionPane.ERROR_MESSAGE);
         return(false);
         else {
    try
    boolean created = file_out.createNewFile();
    if(true)
    fileOutput = new PrintWriter(new FileWriter(fileName_out));
    return(true);
    else
    catch (IOException exc) {
    System.err.println("# Error: " );
    private void outputToFile() throws IOException
    // Initial output
         textArea.append("File name = " + fileName_out + "\n");
         //process();
         // Test if data exists
         if (data != null)
         Date now = new Date();
    DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT);
    String s = df.format(now);
    //long nowlong=now.getTime();
    fileOutput.println(s);
    fileOutput.print(fileName_in.getName() +" of slope value:" + slope);
    textArea.append("File output complete\n\n");
         else
    textArea.append("No data\n\n");
         // End by closing file
         fileOutput.close();
    Thank you so much!

    There's a lot of unnecessary code there, and anyway it isn't formatted in a readable way so I am not going to look too closely at it. But if you want to append to the file if it already exists and create the file if it doesn't, then all you need is this: fileOutput = new PrintWriter(new FileWriter(fileName_out, true));Note the "true" parameter there which (if you look in the API documentation) says that new data will be appended at the end of the file.

  • Help Exporting Embedded Video Files From Flash

    I am new to Flash and this may sound, well dumb but here it goes.  I have taken some video files from Final Cut Pro converted them to FLV's imported them and embedded them into flash to create some banners for the web.  I need to know what settings I should use to get these out of Flash for the web. 
    Also I need to send them to someone to look at before publishing.  What would be the best format to do that in and how to do it.
    Also has anyone has any experience creating banners in or online ads in a Video format like FCP and embedding them into a flash file to export them in flash for we publishing.  Sorry again for the dumb question, just new to Flash.

    Is there a reason why you embedded the video in Flash rather than using the FLV player?
    Starting with the video, since you have the source you can create any type of format you need from that which can be used for preview or the final version depending on where it's  going to end up and what is required or preferred.  Flash comes into play if the requirement is to have a SWF/FLV other than some other video format, or if you have other Flash content going on at the same time besides the video.
    But using Flash for this, the most stratghtforward way is to use the FLV player included with Flash (or another 3rd party player) and point it to your FLV.

  • Please help my flv video file works perfectly localy...but its not visible in remote ftp why??

    hi All,
    Please help me. my flv video file works perfectly localy in
    my computer...but its not visible when i uploaded the flv html and
    flash files to ftp?
    thanks in advance

    This suggestion worked to see the hidden folder(s). Thanks very much, but I feel like I am miles away from moving my ipod music to my new computer and getting it all to work. Here is why...
    1. First when I plug the ipod in, in disk mode, to the USB slot it shows up as a K drive for a minute or so and then disappears. itunes keeps opening, asking me to sync (which will erase all my music on the ipod!) and the K drive (ipod) vanishes.
    2. I pod help says to drag the itunes file out to the desktop and then drag the itunes file on the ipod into the "my music" file within documents and settings. However, there is an "ipod control" file (was hidden) and within this there is the following: artwork, itunes (with 13 subfolders of its own), device, and music. So do I just drag the itunes file inside ipod control into My music? Or do I drag the whole ipod control file? or other?
    3. Additionally there are K drive (ipod) files for calendar, photos, contacts, notes, and ipod control (was hidden). I don't care about any content in the first four, but are they needed to operate? Do I drag these over also to the My music file?
    Whew, very frustrating. Thanks, Ric

  • Please HELP me read this file....!

    I am having trouble reading the file input.dat using this code that I wrote. It compiles without errors but I get an ArrayIndexOutOfBounds Exception when i run my program.
    public void Read(String fileName) {
                    try {
                            String num;
                            String cells;
                            FileReader file = new FileReader(fileName);
                            BufferedReader in = new BufferedReader (file);
                            num = in.readLine();
                            number = Integer.valueOf(num).intValue();
                            co = new ClassObject[number];
                            pair = new PairObject[number * number];
                            System.out.println("There are " + number + " total classes");
                            int cno = 1;
                            int x =0;
                            int y =0;
                            while (in.readLine() != "*") {
                                for (int b=0; b<number; b++){
                                   co[b] = new ClassObject();
                                   co.className = in.readLine();
    co[b].classNumber = cno;
    while (in.readLine() != "$"){ //problem occurs here
    co[b].classAttribute[x] = in.readLine();
    x++;
    while (in.readLine() != "#"){
    co[b].classMethod[y] = in.readLine();
    y++;
    cno++;
    } catch (IOException e) {
    System.out.println("Warning: Cannot Read File");
    System.exit(0);
    }and here is my input file (input.dat): 5
    class1
    int someInt
    $
    getInt()
    class2
    String anyString
    $
    getString()
    class3
    int value
    $
    setValue()
    class4
    char someChar
    $
    getChar()
    class5
    float someFloat
    $
    getFloat()
    * thanks so much for any help!

    Hi, I changed some part of my code but I am still having the same problem. Here is my new code, hopefully somebody can help me figure this out String line = in.readLine();
    while (!"*".equals(line)) {
          for (int b=0; b<number; b++){
           co[b] = new ClassObject();
           co.className = line;
    co[b].classNumber = cno;
    while (!"$".equals(line)){
    co[b].classAttribute[x] = line;
    x++;
    while (!"#".equals(line)){
    co[b].classMethod[y] = line;
    y++;
    cno++;

  • Help with Read/Write File

    hi I was wondering if someone can help me do some read/write file with java. here is what I want to do:
    Read a file and search the whole file for a word such as "throw" and print out the rest of that line to a new file. in the case of "throw", i want to link all thrown exceptions to the file that contained them.
    can someone help me out and let me know what way I can approach in this?
    any help would be greatly appreciated.
    thanks!

    Rough and dirty, here's a class that will read a file and return a resultset:
    import java.io.*;
    import java.nio.*;
    import java.nio.channels.FileChannel;
    import java.util.*;
    import java.text.DateFormat;
    public class Utils{
         File fileName;
         FileOutputStream outputFile;
         boolean closeChannel;
         //Constructor
         public Utils(String directory, String filename){
              String strFileDir = directory;
              String strFileName = filename;          
              File fileDir = new File(strFileDir);
              fileName = new File(fileDir, strFileName);
              // If directory does not exhist, create it.
              if(!fileDir.isDirectory()){
                   if(fileDir.mkdirs()){
                        System.out.println(fileDir + " created.");
                   else{
                        System.out.println(fileDir + " could not be created.");                    
    public ArrayList readText() throws IOException{          
              // Read content of file into a collection
              ArrayList arrayList = new ArrayList();
              try{
                   BufferedReader in = new BufferedReader(new FileReader(fileName));
                   String line;
                   while((line = in.readLine()) != null){
                        arrayList.add(line);
                   in.close();               
              catch (IOException ex){
                   throw ex;
              return arrayList;          
         }And here's how you use the class:
    // Create a new Disk Utilities object.  This can be used for all subsequent read/writes to this file.
              Utils utilTest = new Utils("e:/testing", "Testing.txt");
    // Create a collection to hold the data from the file.
              ArrayList arrayList = new ArrayList();
              try{arrayList = utilTest.readText();}catch(IOException ex){ex.printStackTrace(System.err);}

Maybe you are looking for

  • Can't see the widget in Live view in Dreamweaver CS4 for Mac

    Hi Following this example in http://www.truveo.com/Web-Widgets-in-Dreamweaver-CS4/id/180144024212823976 from Scott Fegette to place a YUI Calendar inside a project in Dreamweaver CS4. I see that Scott after placing the YUI_Calendar.mxp they got the c

  • Did windows vista kill my ipod?

    I recently bought a new computer with windows vista (which I hate, should have gone with the mac). my ipod has been working fine for a very long time now. when I downloaded the newest version of itunes to my new computer and tried to sync my ipod, th

  • How to change the cell value in Excel Sheet in WD Java?

    HI, I have an application which is used to upload and download excel sheet.I can upload the excel sheet through Upload UI element and also able to download the same file through Download UI.But before download I want to validate the excel sheet.If da

  • My Skype to go number

    I have a US based skype number but will be visiting the UK for an extended period. If someone calls my Skype number will it ring through to me in the UK?

  • Itunes is telling me that i cant update my ipod so i cant put songs onto it

    i went on itunes and put songs from a CD into the library. autofill isnt working- it's saying that my ipod can't be updated also wen i manually do it (i drag my songs 2 the ipod tab in the source list) it's cuming up with the same thing! HELP I'M DES