日期:2014-05-17  浏览次数:20819 次

连接
select substr(sys_connect_by_path(meta.code, '.'), 2) 
     from T_META meta where meta.code=#{metaCode}
     start with meta.parent = '@ROOT@' 
     connect by nocycle prior meta.code = meta.parent
------解决方案--------------------
byte[]和InputStream的相互转换如下:

1:byte[]转换为InputStream流

InputStream sbs = new ByteArrayInputStream(byte[] buf);

 

2:InputStream转换为byte[]数组

ByteArrayOutputStream swapStream = new ByteArrayOutputStream();

byte[] buff = new byte[100]; //buff用于存放循环读取的临时数据

int rc = 0;

while ((rc = inStream.read(buff, 0, 100)) > 0) {

swapStream.write(buff, 0, rc);

}

byte[] in_b = swapStream.toByteArray(); //in_b为转换之后的结果