I have still not solved this problem - and it is really starting to frustrate me as you might expect!
I have made a simple demo to demonstrate the problem.
http://atlas.walagata.com/w/peterbon...veToStream.zip
load a jpeg (from the file menu), set the spinedit to anything between 0 and 255 and then click save stream. It will create a stream containing the jpeg and then a byte containing the spin edit number - it will save it to your c route directory. Then close the application, run it again and click load stream. The jpeg will load fine, but the spin edit value will not be what you set it to because of the error in reading the byte after reading the jpeg. If you can get the demo to work so that it correctly reads the byte I can then correct the error in the main program I'm writing.

Thanks - any help will be greatly appreciated.

Peter