i am trying to retrieve meta data from media file approx 1gb

File file = null;
        FileInputStream fis = null;
        byte fullData[] = null;
        byte requiredData[] = null;
        try{
                file = new File(fileName);
                fis = new FileInputStream(file);
                long  filelen=file.length();
                
                 System.out.print("File Length:"+filelen);
                

                
                fullData = new byte[ (int) filelen];
        
                
                
            fis.read(fullData,0,(int)file.length()-11);


            int len = (int)file.length()-11;

            System.out.print("File Length:"+len);



On Tue, Aug 30, 2011 at 3:28 PM, Daniel Drozdzewski
<[email protected]> wrote:
> On 30 August 2011 10:27, NaveenShrivastva <[email protected]> wrote:
>> How to handle here byte array size.
>>
>> On Tue, Aug 30, 2011 at 1:00 PM, Naveen <[email protected]> wrote:
>>> byte[] fullData = new byte[(int) filelen]; here it's byte array
>>> integer type so facing outofmemory data is range of long size. byte
>>> array not taking length long time default typecasting int
>
>
> I am not sure whether I understand you fully, but why would you try to
> create more than 2GB of array in memory?
> It is a big ask even for a desktop machine. I don't think there is a
> phone out there that has such amount of RAM available to the whole
> platform.
>
> For Dalvik VM having heap bigger than 16M could be tricky...
>
> If you are trying to store more than say 4M in a byte array to use in
> your mobile application, you are doing something wrong, and that's
> what causes OutOfMemory, not the fact that you can't use numbers
> bigger than the range of integers.
>
>
> --
> Daniel Drozdzewski
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to