How to convert images to bytes and send out to a stream, then receive bytes from the input stream, and convert the bytes into images again?
For getting bytes from an image:
NSData *imageData = UIImageJPEGRepresentation(image, imageQuality);
For getting an image from bytes:
UIImage *image = [UIImage imageWithData: imageData];
BTW, If you need the bytes from the NSData just call its bytes method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With