(InputProxyStream): generalization of input filters.

This commit is contained in:
morkt
2016-07-02 06:06:32 +04:00
parent cc22f988c6
commit 883ee94a7e
8 changed files with 39 additions and 174 deletions

View File

@@ -42,7 +42,7 @@ namespace GameRes.Formats
}
}
internal class Um3Stream : ProxyStream
internal class Um3Stream : InputProxyStream
{
public Um3Stream (Stream main, bool leave_open = false)
: base (main, leave_open)
@@ -72,15 +72,5 @@ namespace GameRes.Formats
b ^= 0xFF;
return b;
}
public override void Write (byte[] buffer, int offset, int count)
{
throw new NotSupportedException ("Um3Stream.Write not supported");
}
public override void WriteByte (byte value)
{
throw new NotSupportedException ("Um3Stream.Write not supported");
}
}
}

View File

@@ -114,7 +114,7 @@ namespace GameRes.Formats.Bruns
}
}
internal class EencStream : ProxyStream
internal class EencStream : InputProxyStream
{
uint m_key;
@@ -124,8 +124,6 @@ namespace GameRes.Formats.Bruns
m_key = key;
}
public override bool CanWrite { get { return false; } }
public override int Read (byte[] buffer, int offset, int count)
{
int pos = (int)Position & 3;
@@ -146,20 +144,5 @@ namespace GameRes.Formats.Bruns
b ^= (byte)(m_key >> (pos << 3));
return b;
}
public override void SetLength (long length)
{
throw new NotSupportedException ("EencStream.SetLength method is not supported");
}
public override void Write (byte[] buffer, int offset, int count)
{
throw new NotSupportedException ("EencStream.Write method is not supported");
}
public override void WriteByte (byte value)
{
throw new NotSupportedException ("EencStream.WriteByte method is not supported");
}
}
}