Need some help with Streams

BlitzMax Forums/BlitzMax Programming/Need some help with Streams

hmm... maybe something like this :
Type TSubStream Extends TStreamWrapper

	Field start:Int
	Field length:Int
	
	Function Create:TSubStream(stream:TStream, start:Int, length:Int)
		Local this:TSubStream = New TSubStream
		this.SetStream stream
		this.start = start
		this.length = length
		Return this
	End Function
	
	Method Eof:Int()
		Return _stream.Eof() Or (Pos() >= length)
	End Method

	Method Pos:Int()
		Return _stream.Pos() - start
	End Method

	Method Size:Int()
		Return length
	End Method
	
	Method Seek:Int( pos:Int )
		Return _stream.Seek( pos + start )
	End Method

End Type

Untested...