gio: Implement GioStream.SetLength

This commit is contained in:
Gabriel Burt 2010-01-18 09:36:53 +01:00 committed by Bertrand Lorentz
parent 5290f4c520
commit f6009bbde1

View file

@ -218,9 +218,16 @@ namespace GLib
{ {
if (!CanSeek || !CanWrite) if (!CanSeek || !CanWrite)
throw new NotSupportedException ("This stream doesn't support seeking"); throw new NotSupportedException ("This stream doesn't support seeking");
var seekable = stream as Seekable;
if (!seekable.CanTruncate ())
throw new NotSupportedException ("This stream doesn't support truncating");
if (is_disposed) if (is_disposed)
throw new ObjectDisposedException ("The stream is closed"); throw new ObjectDisposedException ("The stream is closed");
throw new NotImplementedException ();
seekable.Truncate (value, null);
} }
public override void Close () public override void Close ()