- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中java.util.zip.ZipInputStream.peekShort()
方法的一些代码示例,展示了ZipInputStream.peekShort()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipInputStream.peekShort()
方法的具体详情如下:
包路径:java.util.zip.ZipInputStream
类名称:ZipInputStream
方法名:peekShort
暂无
代码示例来源:origin: robovm/robovm
int version = peekShort(0) & 0xff;
if (version > ZIPLocalHeaderVersionNeeded) {
throw new ZipException("Cannot read local header version " + version);
int flags = peekShort(LOCFLG - LOCVER);
if ((flags & ZipFile.GPBF_UNSUPPORTED_MASK) != 0) {
throw new ZipException("Invalid General Purpose Bit Flag: " + flags);
int ceLastModifiedTime = peekShort(LOCTIM - LOCVER);
int ceLastModifiedDate = peekShort(LOCTIM - LOCVER + 2);
int ceCompressionMethod = peekShort(LOCHOW - LOCVER);
long ceCrc = 0, ceCompressedSize = 0, ceSize = -1;
if (!hasDD) {
ceSize = ((long) Memory.peekInt(hdrBuf, LOCLEN - LOCVER, ByteOrder.LITTLE_ENDIAN)) & 0xffffffffL;
int nameLength = peekShort(LOCNAM - LOCVER);
if (nameLength == 0) {
throw new ZipException("Entry is not named");
int extraLength = peekShort(LOCEXT - LOCVER);
代码示例来源:origin: ibinti/bugvm
int version = peekShort(0) & 0xff;
if (version > ZIPLocalHeaderVersionNeeded) {
throw new ZipException("Cannot read local header version " + version);
int flags = peekShort(LOCFLG - LOCVER);
if ((flags & ZipFile.GPBF_UNSUPPORTED_MASK) != 0) {
throw new ZipException("Invalid General Purpose Bit Flag: " + flags);
int ceLastModifiedTime = peekShort(LOCTIM - LOCVER);
int ceLastModifiedDate = peekShort(LOCTIM - LOCVER + 2);
int ceCompressionMethod = peekShort(LOCHOW - LOCVER);
long ceCrc = 0, ceCompressedSize = 0, ceSize = -1;
if (!hasDD) {
ceSize = ((long) Memory.peekInt(hdrBuf, LOCLEN - LOCVER, ByteOrder.LITTLE_ENDIAN)) & 0xffffffffL;
int nameLength = peekShort(LOCNAM - LOCVER);
if (nameLength == 0) {
throw new ZipException("Entry is not named");
int extraLength = peekShort(LOCEXT - LOCVER);
代码示例来源:origin: MobiVM/robovm
int version = peekShort(0) & 0xff;
if (version > ZIPLocalHeaderVersionNeeded) {
throw new ZipException("Cannot read local header version " + version);
int flags = peekShort(LOCFLG - LOCVER);
if ((flags & ZipFile.GPBF_UNSUPPORTED_MASK) != 0) {
throw new ZipException("Invalid General Purpose Bit Flag: " + flags);
int ceLastModifiedTime = peekShort(LOCTIM - LOCVER);
int ceLastModifiedDate = peekShort(LOCTIM - LOCVER + 2);
int ceCompressionMethod = peekShort(LOCHOW - LOCVER);
long ceCrc = 0, ceCompressedSize = 0, ceSize = -1;
if (!hasDD) {
ceSize = ((long) Memory.peekInt(hdrBuf, LOCLEN - LOCVER, ByteOrder.LITTLE_ENDIAN)) & 0xffffffffL;
int nameLength = peekShort(LOCNAM - LOCVER);
if (nameLength == 0) {
throw new ZipException("Entry is not named");
int extraLength = peekShort(LOCEXT - LOCVER);
代码示例来源:origin: FlexoVM/flexovm
int version = peekShort(0) & 0xff;
if (version > ZIPLocalHeaderVersionNeeded) {
throw new ZipException("Cannot read local header version " + version);
int flags = peekShort(LOCFLG - LOCVER);
if ((flags & ZipFile.GPBF_UNSUPPORTED_MASK) != 0) {
throw new ZipException("Invalid General Purpose Bit Flag: " + flags);
int ceLastModifiedTime = peekShort(LOCTIM - LOCVER);
int ceLastModifiedDate = peekShort(LOCTIM - LOCVER + 2);
int ceCompressionMethod = peekShort(LOCHOW - LOCVER);
long ceCrc = 0, ceCompressedSize = 0, ceSize = -1;
if (!hasDD) {
ceSize = ((long) Memory.peekInt(hdrBuf, LOCLEN - LOCVER, ByteOrder.LITTLE_ENDIAN)) & 0xffffffffL;
int nameLength = peekShort(LOCNAM - LOCVER);
if (nameLength == 0) {
throw new ZipException("Entry is not named");
int extraLength = peekShort(LOCEXT - LOCVER);
代码示例来源:origin: com.mobidevelop.robovm/robovm-rt
int version = peekShort(0) & 0xff;
if (version > ZIPLocalHeaderVersionNeeded) {
throw new ZipException("Cannot read local header version " + version);
int flags = peekShort(LOCFLG - LOCVER);
if ((flags & ZipFile.GPBF_UNSUPPORTED_MASK) != 0) {
throw new ZipException("Invalid General Purpose Bit Flag: " + flags);
int ceLastModifiedTime = peekShort(LOCTIM - LOCVER);
int ceLastModifiedDate = peekShort(LOCTIM - LOCVER + 2);
int ceCompressionMethod = peekShort(LOCHOW - LOCVER);
long ceCrc = 0, ceCompressedSize = 0, ceSize = -1;
if (!hasDD) {
ceSize = ((long) Memory.peekInt(hdrBuf, LOCLEN - LOCVER, ByteOrder.LITTLE_ENDIAN)) & 0xffffffffL;
int nameLength = peekShort(LOCNAM - LOCVER);
if (nameLength == 0) {
throw new ZipException("Entry is not named");
int extraLength = peekShort(LOCEXT - LOCVER);
代码示例来源:origin: com.gluonhq/robovm-rt
int version = peekShort(0) & 0xff;
if (version > ZIPLocalHeaderVersionNeeded) {
throw new ZipException("Cannot read local header version " + version);
int flags = peekShort(LOCFLG - LOCVER);
if ((flags & ZipFile.GPBF_UNSUPPORTED_MASK) != 0) {
throw new ZipException("Invalid General Purpose Bit Flag: " + flags);
int ceLastModifiedTime = peekShort(LOCTIM - LOCVER);
int ceLastModifiedDate = peekShort(LOCTIM - LOCVER + 2);
int ceCompressionMethod = peekShort(LOCHOW - LOCVER);
long ceCrc = 0, ceCompressedSize = 0, ceSize = -1;
if (!hasDD) {
ceSize = ((long) Memory.peekInt(hdrBuf, LOCLEN - LOCVER, ByteOrder.LITTLE_ENDIAN)) & 0xffffffffL;
int nameLength = peekShort(LOCNAM - LOCVER);
if (nameLength == 0) {
throw new ZipException("Entry is not named");
int extraLength = peekShort(LOCEXT - LOCVER);
代码示例来源:origin: com.jtransc/jtransc-rt
int version = peekShort(0) & 0xff;
if (version > ZIPLocalHeaderVersionNeeded) {
throw new ZipException("Cannot read local header version " + version);
int flags = peekShort(LOCFLG - LOCVER);
if ((flags & ZipFile.GPBF_UNSUPPORTED_MASK) != 0) {
throw new ZipException("Invalid General Purpose Bit Flag: " + flags);
int ceLastModifiedTime = peekShort(LOCTIM - LOCVER);
int ceLastModifiedDate = peekShort(LOCTIM - LOCVER + 2);
int ceCompressionMethod = peekShort(LOCHOW - LOCVER);
long ceCrc = 0, ceCompressedSize = 0, ceSize = -1;
if (!hasDD) {
ceSize = ((long) Memory.peekInt(hdrBuf, LOCLEN - LOCVER, true)) & 0xffffffffL;
int nameLength = peekShort(LOCNAM - LOCVER);
if (nameLength == 0) {
throw new ZipException("Entry is not named");
int extraLength = peekShort(LOCEXT - LOCVER);
代码示例来源:origin: com.bugvm/bugvm-rt
int version = peekShort(0) & 0xff;
if (version > ZIPLocalHeaderVersionNeeded) {
throw new ZipException("Cannot read local header version " + version);
int flags = peekShort(LOCFLG - LOCVER);
if ((flags & ZipFile.GPBF_UNSUPPORTED_MASK) != 0) {
throw new ZipException("Invalid General Purpose Bit Flag: " + flags);
int ceLastModifiedTime = peekShort(LOCTIM - LOCVER);
int ceLastModifiedDate = peekShort(LOCTIM - LOCVER + 2);
int ceCompressionMethod = peekShort(LOCHOW - LOCVER);
long ceCrc = 0, ceCompressedSize = 0, ceSize = -1;
if (!hasDD) {
ceSize = ((long) Memory.peekInt(hdrBuf, LOCLEN - LOCVER, ByteOrder.LITTLE_ENDIAN)) & 0xffffffffL;
int nameLength = peekShort(LOCNAM - LOCVER);
if (nameLength == 0) {
throw new ZipException("Entry is not named");
int extraLength = peekShort(LOCEXT - LOCVER);
下面是代码片段。 while (iterator.hasNext()) { FileItemStream item = iterator.next(); InputStream in
我有 Java 代码,它传入一个 Zip 文件列表,其中一个文件的格式故意错误。该 Zip 文件位于列表末尾。 我的代码看起来有点像: System.out.println("Hi Stinky Pe
如果我使用包含一些带有变音符号的文件(例如 1-2GF-969##JÖN.pdf)的 zip 文件运行以下程序,我会得到 IllegalArgumentException。 我的应用程序必须支持所有语
下面是一些从仅包含一个文件的 zip 文件中提取文件的代码。但是,提取的文件与通过 WinZip 或其他压缩实用程序提取的同一文件不匹配。如果文件包含奇数个字节,我预计它可能会关闭一个字节(因为我的缓
我正在尝试从 ZIP 存档中读取 XML 文件。相关代码如下: ZipInputStream zis = new ZipInputStream(is); ZipEntry entry = zis.ge
我正在开发一个电子阅读器应用程序(使用 skyepub ),它基本上将加密的书籍下载到文件系统中(并将解密 key 保存在数据库中),当用户尝试阅读它时,它会加载将书存入内存并解密。 问题是有些书的第
我正在尝试从 ZIP 存档中读取 XML 文件。相关代码如下: ZipInputStream zis = new ZipInputStream(is); ZipEntry entry = zis.ge
有java.io.ZipInputStream膨胀和java.io.ZipOutputStream这会泄气。 但有时我不希望这样。有时,当使用接受 InputStream 的第三方 API 时,我想要
我想知道是否有一种方法可以直接从 ZipFile/ZipInputStream 读取特定文件,而不必遍历整个条目集。我想这可能是一个很大的开销,如果存档包含大量文件。有没有更好的办法? 我知道这可以用
因此,在 ZIP 文件的末尾,例如最后 64K,有一个中央目录,从中您可以看到 ZIP 文件本身包含的内容。 现在我已将 ZIP 文件加载到 ZipInputStream 中,在此之前我已声明一个 l
我有一个 JSF 应用程序(Majorra 2.1.20、PrimeFaces 4.0-SNAPSHOT、OmniFaces 1.4.1,在 Glassfish 3.1.2 上运行),可以在 Fire
那么使用ZipInputStream时,要在WEB上获取Zip文件的InputStream,使用时是否会将整个ZIP文件下载到用户计算机中? 例如,如果程序使用 ZipInputStream 来查看
在我们完全读取流之前,是否可以找到/估计 ZipInputStream 的大小? 例如,我们可以在读取用户数据之前使用 getNextEntry 获取条目的元数据。 Inputstream 有一个方法
我可以通过 ZipInputStream,但在开始迭代之前,我想获取迭代期间所需的特定文件。我该怎么做? ZipInputStream zin = new ZipInputStream(myInput
我正在使用 AsyncTask 解压缩文件,一切似乎都进行得很顺利(ZIP 存档中的所有文件都已提取),但我的解压缩方法从未完成。 这是我的解压类的源代码: public class MyUnzipp
假设我们有这样的代码: File file = new File("zip1.zip"); ZipInputStream zis = new ZipInputStream(new FileInputS
我们正在尝试修改 2007 MS Excel 中的 XML 文件之一。为此,将使用 Java 的 ZipInputStream 解压缩 xlsx 文件,然后使用 ZipOutputStream 将其复
我正在尝试从 zip 中解压缩特定文件。我首先得到一个ZipInputStream: ZipInputStream zipIn = new ZipInputStream(new BufferedInp
我做了this问题,我看到存在一个名为 ZipInputStream 的构造函数: ZipInputStream(BufferedInputStream, 字符集) 但是调试器向我抛出错误: ZipI
private byte[] loadClassData(String className) { ZipInputStream in = null; FileInputStream f
我是一名优秀的程序员,十分优秀!