I'm trying to send a small image (PNG or JPG) from my computer to my blackberry simulator via a socket. The entire image seems to transfer fine, the problem arises when I try to display it, by calling:
EncodedImage.createEncodedImage(data, 0, data.length);
Bitmap.createBitmapFromBytes(data, 0, -1, 0);
Bitmap.createBitmapFromPNG(data, 0, -1);
I keep getting an IllegalArgumentException error when I call any of these functions with the byte that I pass into the constructor of my derived MainScreen class. I don't know what else to do; I've looked up countless other forum posts and used their code to transfer, and it still doesn't work. Here's how I'm connecting to the server:
SocketConnection sc = (SocketConnection) Connector.open("socket://<my computer's IP>:5000;deviceside=true");
Please let me know if you guys need any more information. The simulator I'm using is for the BB Storm, and I can copy all the code for both the server and the simulator if needed. I am desperate to find a solution for this.