ios - Transfer Multiple Images via NSInputStream/NSOutputStream -
i have 2 nsinputstream
, nsoutputstream
connected each other via network. want transfer core info objects , associated images 1 device other device. have converted core info objects json
, transferred other side of stream , populated core info json
. there images associated each recorded. images on disc, there path stored in core info objects. now, have have finish info @ hand when writing output stream
. have xml
(that contains json
) ready. 1. how transfer images (nsdata *
) along xml
(also nsdata *
) ? how differentiate @ reading end (nsinputstream
) between xml , images? 2. also, have transfer multiple images, how tell @ nsinputstream
end bytes of image have finished , the bytes of next image have started ? 3. how know image (name) has been transferred ? thanks
convert nsdata
(of each uiimage
) nsstring
representation, set nsstring
objects nsdictionary
, serialize dictionary. in way when transfer info on can reverse process extract images knowing key points image. way should able transfer multiple images.
hope helps.
cheers
ios image nsstream nsinputstream nsoutputstream
No comments:
Post a Comment