it works!
What let you think it will not work? Maybe your requirements does not fit the possibilities of writetext
if your buffer is for example a bytearray then you could do it like this
Dim out As OutputStream
out = File.OpenOutput(File.DirDefaultExternal,"abc.dat",False)
out.WriteBytes(buffer,0,buffer.length)
out.Flush
out.Close
But reading the documentation could help to find it yourself!