0
0과 1 만 포함하는 BLOB를 삽입하려고합니다.하지만 작동하지 않습니다. 먼저 비트 맵을 가져 와서 이진 이미지로 변환합니다. 그 다음에는 blob로 데이터베이스에 삽입하려고합니다. 그러나 데이터베이스 행은 비어 있습니다. 코드는 다음과 같습니다.Android Sqlite BLOB 삽입
Otsu(retpix,picw,pich);
byte[] byteimage = new byte[length << 2];
for (int di=0; di<144; di++) {
int x = retpix[di];
int j = di << 2;
byteimage[j++] = (byte) ((x >>> 0) & 0xff);
byteimage[j++] = (byte) ((x >>> 8) & 0xff);
byteimage[j++] = (byte) ((x >>> 16) & 0xff);
byteimage[j++] = (byte) ((x >>> 24) & 0xff);
}
String PutName = "imagearray";
cv.put(PutName, byteimage);
db.insert("IMAGES", null, cv);
db.close();