Translate

> > Read File Content and convert to ByteArray

Read File Content and convert to ByteArray

Posted on Tuesday, April 5, 2011 | No Comments

    private function imageByte(imgLocaction:String):ByteArray {
            var byte:ByteArray = new ByteArray;
            var imgFile:File = new File(imgLocaction);
            var dataStream:FileStream = new FileStream();
            dataStream.open(imgFile,FileMode.READ);
            dataStream.readBytes(byte,0,byte.length);
            dataStream.close();
            return byte;
    }

Leave a Reply

Powered by Blogger.