BLOB to String[][]
Is there a way to directly convert a "开发者_JS百科BLOB"-array into a String[][]-array (on Android?
Thanks very much in advance!
From what I understand, blobs return bytes. So you want to build a byte array and then build the string from that. This is an example.
Hope it gives you a good start.
Try this: Converting blob array to string array:
BLOB[] blobs = getBlobs(); //fetch it somehow
String[] strings = new String[blobs.length];
for(int i = 0; i < blobs.length; i++)
strings[i] = new String(blobs[i].getBytes(0, blobs[i].length());
return strings;
Converting blob array to string matrix:
BLOB[] blobs = getBlobs(); //fetch it somehow
String[][] strings = new String[blobs.length][];
for(int i = 0; i < blobs.length; i++)
strings[i] = blobToStringArray(blobs[i]);
return strings;
My solution doesn't require codingBLOBs to String[][]-arrays anymore, now I am (de-)coding SoapEnvelopes to byte-arrays and vice versa using a method described here: http://androiddevblog.blogspot.com/2010/04/serializing-and-parceling-ksoap2.html
精彩评论