mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2025-12-09 14:53:30 +08:00
WIP: CompressSave 1.2.0
This commit is contained in:
50
CompressSave/Wrapper/BlackHoleStream.cs
Normal file
50
CompressSave/Wrapper/BlackHoleStream.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace CompressSave.Wrapper;
|
||||
|
||||
class BlackHoleStream : Stream
|
||||
{
|
||||
private long length;
|
||||
|
||||
public override bool CanRead => true;
|
||||
|
||||
public override bool CanSeek => false;
|
||||
|
||||
public override bool CanWrite => true;
|
||||
|
||||
public override long Length => length;
|
||||
|
||||
public override long Position { get; set; }
|
||||
|
||||
public BlackHoleStream()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void Flush()
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
public override int Read(byte[] buffer, int offset, int count)
|
||||
{
|
||||
return count;
|
||||
}
|
||||
|
||||
public override long Seek(long offset, SeekOrigin origin)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override void SetLength(long value)
|
||||
{
|
||||
length = value;
|
||||
}
|
||||
public byte[] testBuffer = new byte[1024 * 1024];
|
||||
|
||||
public override void Write(byte[] buffer, int offset, int count)
|
||||
{
|
||||
Array.Copy(buffer, offset, testBuffer, 0, Math.Min(count, testBuffer.Length));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user