| 288 | } |
| 289 | |
| 290 | ZipArchiveStreamEntry* ZipArchiveStreamEntry::CreateRaw(ZipArchiveHandle handle, |
| 291 | const ZipEntry& entry) { |
| 292 | ZipArchiveStreamEntry* stream = nullptr; |
| 293 | if (entry.method == kCompressStored) { |
| 294 | // Not compressed, don't need to do anything special. |
| 295 | stream = new ZipArchiveStreamEntryUncompressed(handle); |
| 296 | } else { |
| 297 | stream = new ZipArchiveStreamEntryRawCompressed(handle); |
| 298 | } |
| 299 | if (stream && !stream->Init(entry)) { |
| 300 | delete stream; |
| 301 | stream = nullptr; |
| 302 | } |
| 303 | return stream; |
| 304 | } |