Tamir.Streams.JStream.skip C# (CSharp) Method

skip() public method

public skip ( long len ) : long
len long
return long
		public long skip(long len)
		{
			//Seek doesn't work
			//return Seek(offset, IO.SeekOrigin.Current);
			int i=0;
			int count = 0;
			byte[] buf = new byte[len];
			while(len>0)
			{
				i=Read(buf, count, (int)len);//tamir: possible lost of pressision
				if(i<=0)
				{
					throw new Exception("inputstream is closed");
					//return (s-foo)==0 ? i : s-foo;
				}
				count+=i;
				len-=i;
			}
			return count;
		}