RT,库中存的是16进制的BLOB类型的值,对象中定义的是String类型接收,请问大佬们,如何转?

解决方案 »

  1.   

    首先判断blob数据是否为空,然后采用输入流读出数据String content = null; 
        try {
      
         if(image != null){
          InputStream is = image.getBinaryStream();
          byte[] b = new byte[is.available()];
          is.read(b, 0, b.length);
          content = new String(b); 
         }
       System.out.println(content);
       } catch ( IOException e) {
        e.printStackTrace();
       }
      

  2.   


    项目中这个字段是 String类型修饰的 
      

  3.   

    先转byte数组,再转string字符
      

  4.   

    要不要给你移动到 高级语言区 ?是 java 还是 C#