gio: Implement GioStream.SetLength
This commit is contained in:
parent
5290f4c520
commit
f6009bbde1
1 changed files with 8 additions and 1 deletions
|
@ -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 ()
|
||||||
|
|
Loading…
Reference in a new issue