Files
2026-06-04 11:42:34 +02:00

113 lines
2.5 KiB
C#

using System;
using System.IO;
namespace Google.Protobuf
{
// Token: 0x02000013 RID: 19
internal sealed class LimitedInputStream : Stream
{
// Token: 0x06000129 RID: 297 RVA: 0x00007609 File Offset: 0x00005809
internal LimitedInputStream(Stream proxied, int size)
{
this.proxied = proxied;
this.bytesLeft = size;
}
// Token: 0x17000024 RID: 36
// (get) Token: 0x0600012A RID: 298 RVA: 0x0000324B File Offset: 0x0000144B
public override bool CanRead
{
get
{
return true;
}
}
// Token: 0x17000025 RID: 37
// (get) Token: 0x0600012B RID: 299 RVA: 0x0000761F File Offset: 0x0000581F
public override bool CanSeek
{
get
{
return false;
}
}
// Token: 0x17000026 RID: 38
// (get) Token: 0x0600012C RID: 300 RVA: 0x0000761F File Offset: 0x0000581F
public override bool CanWrite
{
get
{
return false;
}
}
// Token: 0x0600012D RID: 301 RVA: 0x00007622 File Offset: 0x00005822
public override void Flush()
{
}
// Token: 0x17000027 RID: 39
// (get) Token: 0x0600012E RID: 302 RVA: 0x00007624 File Offset: 0x00005824
public override long Length
{
get
{
throw new NotSupportedException();
}
}
// Token: 0x17000028 RID: 40
// (get) Token: 0x0600012F RID: 303 RVA: 0x00007624 File Offset: 0x00005824
// (set) Token: 0x06000130 RID: 304 RVA: 0x00007624 File Offset: 0x00005824
public override long Position
{
get
{
throw new NotSupportedException();
}
set
{
throw new NotSupportedException();
}
}
// Token: 0x06000131 RID: 305 RVA: 0x0000762C File Offset: 0x0000582C
public override int Read(byte[] buffer, int offset, int count)
{
if (this.bytesLeft > 0)
{
int num = this.proxied.Read(buffer, offset, Math.Min(this.bytesLeft, count));
this.bytesLeft -= num;
return num;
}
return 0;
}
// Token: 0x06000132 RID: 306 RVA: 0x00007624 File Offset: 0x00005824
public override long Seek(long offset, SeekOrigin origin)
{
throw new NotSupportedException();
}
// Token: 0x06000133 RID: 307 RVA: 0x00007624 File Offset: 0x00005824
public override void SetLength(long value)
{
throw new NotSupportedException();
}
// Token: 0x06000134 RID: 308 RVA: 0x00007624 File Offset: 0x00005824
public override void Write(byte[] buffer, int offset, int count)
{
throw new NotSupportedException();
}
// Token: 0x04000048 RID: 72
private readonly Stream proxied;
// Token: 0x04000049 RID: 73
private int bytesLeft;
}
}