one thing you need to know about streams is that they work as huge stacks of data chunks. how you access them, depends on what you drop into. as SilverWarior said, with a fixed size chunk you just need to get or to put chunks one after the other. with variable size you need some kind of info in advance to be able to get/put data chunks as you need them. you can put a longint just before the data chunk, so you know the size before read it. also you can keep an index to where you put things inside the stream.