程式碼如下:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
public byte[] blob2ByteArr(Blob blob) throws Exception {
byte[] b = null;
try {
if (blob != null) {
long in = 0;
b = blob.getBytes(in, (int) (blob.length()));
}
} catch (Exception e) {
e.printStackTrace();
throw new Exception("fault");
return b;
程式碼如下:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
public byte[] blob2ByteArr(Blob blob) throws Exception {
byte[] b = null;
try {
if (blob != null) {
long in = 0;
b = blob.getBytes(in, (int) (blob.length()));
}
} catch (Exception e) {
e.printStackTrace();
throw new Exception("fault");
}
return b;
}