首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 媒体动画 > flex >

Flex 与 Java 下传ByteArray图片数据

2012-09-23 
Flex 与 Java 上传ByteArray图片数据Flex 端的上传代码:String filePath c:/test.pngInputStream inp

Flex 与 Java 上传ByteArray图片数据

Flex 端的上传代码:

String filePath = "c:/test.png";        InputStream inputStream = request.getInputStream();        FileOutputStream outputStream = new FileOutputStream(new File(filePath));       int formlength = request.getContentLength();byte[] formcontent = new byte[formlength];int totalread = 0;int nowread = 0;while (totalread < formlength) {nowread = inputStream.read(formcontent, totalread, formlength);totalread += nowread;}        outputStream.write(formcontent);        outputStream.flush();        outputStream.close();        inputStream.close();

?

热点排行