zipEntry.content([options])
options<Object>verify<boolean> 验证条目的 CRC-32 校验和。默认值:true。maxSize<number> 在分配任何内容之前,拒绝声明超过此数量的未压缩字节的内容。默认值:zlib.getMaxZipContentSize().
- 返回:<Promise> 充满了一个 <Buffer>,其中包含条目的解压内容。这个缓冲区是一个全新的副本,不与档案或条目创建时的数据共享任何内存。
如果条目声明的大小超过 maxSize,会抛出 ERR_ZIP_ENTRY_TOO_LARGE 错误;如果内容未通过 CRC-32 校验或与声明的大小不符,会抛出 ERR_ZIP_ENTRY_CORRUPT 错误;对于内容尚不可用的流式条目 (zlib.ZipEntry.createStream()),会抛出 ERR_INVALID_STATE 错误(参见该方法了解流式条目何时可读)。
🌐 Throws an ERR_ZIP_ENTRY_TOO_LARGE error if the entry's declared size
exceeds maxSize, an ERR_ZIP_ENTRY_CORRUPT error if the content fails
CRC-32 verification or does not match its declared size, and an
ERR_INVALID_STATE error for a streaming entry
(zlib.ZipEntry.createStream()) whose content is not yet available (see
that method for when a streaming entry becomes readable).