hi, i tried to get image from other PC using VB under socket and i could display the image again using the byte of array read from the image file in my PC, when VB sent to b4a AStream received the string completely and equal to the original one,
Issues :
1. When i tried to save using below methods
Where cPackage is the image string that has been decoded back using Decode64
Dim out As OutputStream
aBuff = conv.StringToBytes(cPackage, "UTF8")
out = File.OpenOutput(File.DirRootExternal, "test.jpg", False)
out.WriteBytes(aBuff, 0, aBuff.Length)
out.close
it saved the image, but the image is massy not like the original one.
2. When i tried to save using Base64Con using below method
https://www.b4x.com/android/forum/posts/636126/
Base64Con.DecodeToImage(cPackage) it raised error :
An error has occured in sub:main $ResumableSub_AStreams_NewDataResume(java line:722)
java.lang.NullPointerException:Attempt to invoke virtual method 'byte[] anywheresoftware.b4a.objects.StringUtils.DecodeBase64(java.lang.String)' on a null reference
Continue ?
Any advice, tks
Issues :
1. When i tried to save using below methods
Where cPackage is the image string that has been decoded back using Decode64
Dim out As OutputStream
aBuff = conv.StringToBytes(cPackage, "UTF8")
out = File.OpenOutput(File.DirRootExternal, "test.jpg", False)
out.WriteBytes(aBuff, 0, aBuff.Length)
out.close
it saved the image, but the image is massy not like the original one.
2. When i tried to save using Base64Con using below method
https://www.b4x.com/android/forum/posts/636126/
Base64Con.DecodeToImage(cPackage) it raised error :
An error has occured in sub:main $ResumableSub_AStreams_NewDataResume(java line:722)
java.lang.NullPointerException:Attempt to invoke virtual method 'byte[] anywheresoftware.b4a.objects.StringUtils.DecodeBase64(java.lang.String)' on a null reference
Continue ?
Any advice, tks