java io InputStream 转 byte


InputStream is ;

ByteArrayOutputStream baos = new ByteArrayOutputStream();


byte[] b = new byte[1024];

int len = 0;

while((len = is.read(b)) != -1) {

baos.write(b,o,len);

}


baos.toByteArray();



posted on 2016-09-20 00:09  _故乡的原风景  阅读(128)  评论(0编辑  收藏  举报