does anyone have an idea? I want to set byte[] as argument..

On 10月13ζ—₯, 午後11:58, dai <[EMAIL PROTECTED]> wrote:
> Hi, could you anybody know how to save data using FileoutputStream
> like below with byte[] argument?
> Upon standard java platform, I could save data as zip using
> FileOutputStream with byte[] argument however on Android platform, the
> method does not have wirte(byte[]) but it does have write(byte[]).
>
> Is thie meaning that I can only chante byte[] to String looking around
> web pages? Or is there anything that I have to consider because of
> android specific manners like this..??
>
> // Android Platform
>         public void write(Context context, String data){
>                 byte[] outdata = Base64.decode(data);
>                 FileOutputStream fos = null;
>                 BufferedWriter out = null;
>                 try {
>                         fos = context.openFileOutput("output.zip", 0);
>                         out = new BufferedWriter(new OutputStreamWriter(fos));
>                         out.write( ????? );
>                         out.flush();
>                         out.close();
>                         fos.close();
>                } catch(....
>
> // Standard Java Platform
>         public void write(String data){
>                try {
>                         byte[] outdata = Base64.decodeBase64(data.getBytes());
>
>                         File of = new File("output.zip");
>                         FileOutputStream osf = new FileOutputStream(of);
>                         osf.write(outdata);
>                         osf.flush();
>                } catch ....
>
> Thank you so much
--~--~---------~--~----~------------~-------~--~----~
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