Hi, Dear All,

    Now, there is an issue worried me very much.
    I constructed a small application(myapp), and try to copy a big
size(about 150M) file to some other folders; but it always crashed.
>From the log, I found it was caused by low memory issue: it will kill
some other processes first, but it will kill the process myapp at
last.
    Below is my sample code:
=========================================
        FileInputStream input=new FileInputStream(srcFile);
        FileOutputStream output=new FileOutputStream(desFile);
        byte[] b=new byte[4*1024];  //4k buffer
        int len;

        try{
            while(-1 != (len=input.read(b))){
                output.write(b,0,len);

            }
        }catch(IOException e){

        }finally{
            output.flush();
            output.close();
            input.close();
        }
====================================

    Could anyone give me some advice? Thanks in advance!

BRs,
Pinfiled

--~--~---------~--~----~------------~-------~--~----~
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