public Stream OpenInputFileStream(string path, FileMode mode, FileAccess access, FileShare share, int bufferSize)
{
//Unfortunately, the stream the zip reader uses is not seekable, and the DLR requires seekable
//streams to be returnd from this method.
ZipEntry entry = GetEntry(path);
if (entry != null && entry.IsDirectory == false)
{
Stream reader = entry.OpenReader();
if (reader.CanSeek && reader.CanRead)
new BufferedStream(reader);
using (reader)
{
return reader.ToMemoryStream();
}
}
throw new DirectoryNotFoundException(GetFullName(path) + " cannot be found and cannot be opened for reading.");
}