4 namespace SharpCompress.Common
6 internal class EntryStream : Stream
9 private bool completed;
10 private bool isDisposed;
12 internal EntryStream(Stream stream)
18 /// When reading a stream from OpenEntryStream, the stream must be completed so use this to finish reading the entire entry.
20 public void SkipEntry()
22 var buffer = new byte[4096];
23 while (Read(buffer, 0, buffer.Length) > 0)
29 protected override void Dispose(bool disposing)
33 throw new InvalidOperationException(
34 "EntryStream has not been fully consumed. Read the entire stream or use SkipEntry.");
41 base.Dispose(disposing);
45 public override bool CanRead
50 public override bool CanSeek
55 public override bool CanWrite
60 public override void Flush()
62 throw new System.NotImplementedException();
65 public override long Length
67 get { throw new System.NotImplementedException(); }
70 public override long Position
72 get { throw new System.NotImplementedException(); }
73 set { throw new System.NotImplementedException(); }
76 public override int Read(byte[] buffer, int offset, int count)
78 int read = stream.Read(buffer, offset, count);
86 public override long Seek(long offset, SeekOrigin origin)
88 throw new System.NotImplementedException();
91 public override void SetLength(long value)
93 throw new System.NotImplementedException();
96 public override void Write(byte[] buffer, int offset, int count)
98 throw new System.NotImplementedException();