论坛首页 入门技术论坛

将字节数组转为输出流

浏览 3564 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2008-12-26  
/**
	 * 将字节数组转为输出流
	 * 
	 * @param b
	 * @return
	 */
	public static InputStream getInputStreamFromBytes(byte[] b) {
		InputStream ret = null;
		try {
			if (b == null || b.length <= 0) {
				log.error("helper:the byte is null or is empty!");
				return ret;
			}
			ret = new ByteArrayInputStream(b);
		} catch (Exception e) {
			log.error("helper:get inputstream from bytes process error!");
			e.printStackTrace();
		}
		return ret;
	}

 

论坛首页 入门技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics