org.eclipse.jdt.internal.compiler.util.Util.getZipEntryByteContent()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(8.7k)|赞(0)|评价(0)|浏览(144)

本文整理了Java中org.eclipse.jdt.internal.compiler.util.Util.getZipEntryByteContent()方法的一些代码示例,展示了Util.getZipEntryByteContent()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.getZipEntryByteContent()方法的具体详情如下:
包路径:org.eclipse.jdt.internal.compiler.util.Util
类名称:Util
方法名:getZipEntryByteContent

Util.getZipEntryByteContent介绍

[英]Returns the contents of the given zip entry as a byte array.
[中]以字节数组的形式返回给定zip项的内容。

代码示例

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

private char[] readSource(ZipEntry entry, ZipFile zip, String charSet) {
  try {
    byte[] bytes = Util.getZipEntryByteContent(entry, zip);
    if (bytes != null) {
      // Order of preference: charSet supplied, this.encoding or this.defaultEncoding in that order
      return Util.bytesToChar(bytes, charSet == null ? (this.encoding == null ? this.defaultEncoding : this.encoding) : charSet);
    }
  } catch (IOException e) {
    // ignore
  }
  return null;
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

private char[] readSource(ZipEntry entry, ZipFile zip, String charSet) {
  try {
    byte[] bytes = Util.getZipEntryByteContent(entry, zip);
    if (bytes != null) {
      // Order of preference: charSet supplied, this.encoding or this.defaultEncoding in that order
      return Util.bytesToChar(bytes, charSet == null ? (this.encoding == null ? this.defaultEncoding : this.encoding) : charSet);
    }
  } catch (IOException e) {
    // ignore
  }
  return null;
}

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

private char[] readSource(ZipEntry entry, ZipFile zip, String charSet) {
  try {
    byte[] bytes = Util.getZipEntryByteContent(entry, zip);
    if (bytes != null) {
      return Util.bytesToChar(bytes, charSet == null ? this.encoding : charSet);
    }
  } catch (IOException e) {
    // ignore
  }
  return null;
}

代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core

private char[] readSource(ZipEntry entry, ZipFile zip, String charSet) {
  try {
    byte[] bytes = Util.getZipEntryByteContent(entry, zip);
    if (bytes != null) {
      // Order of preference: charSet supplied, this.encoding or this.defaultEncoding in that order
      return Util.bytesToChar(bytes, charSet == null ? (this.encoding == null ? this.defaultEncoding : this.encoding) : charSet);
    }
  } catch (IOException e) {
    // ignore
  }
  return null;
}

代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

private char[] readSource(ZipEntry entry, ZipFile zip, String charSet) {
  try {
    byte[] bytes = Util.getZipEntryByteContent(entry, zip);
    if (bytes != null) {
      // Order of preference: charSet supplied, this.encoding or this.defaultEncoding in that order
      return Util.bytesToChar(bytes, charSet == null ? (this.encoding == null ? this.defaultEncoding : this.encoding) : charSet);
    }
  } catch (IOException e) {
    // ignore
  }
  return null;
}

代码示例来源:origin: trylimits/Eclipse-Postfix-Code-Completion

private char[] readSource(ZipEntry entry, ZipFile zip, String charSet) {
  try {
    byte[] bytes = Util.getZipEntryByteContent(entry, zip);
    if (bytes != null) {
      // Order of preference: charSet supplied, this.encoding or this.defaultEncoding in that order
      return Util.bytesToChar(bytes, charSet == null ? (this.encoding == null ? this.defaultEncoding : this.encoding) : charSet);
    }
  } catch (IOException e) {
    // ignore
  }
  return null;
}

代码示例来源:origin: org.eclipse.jdt.core.compiler/ecj

@Override
public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException {
  if (getKind() == Kind.SOURCE) {
    try (ZipFile zipFile2 = new ZipFile(this.file)) {
      ZipEntry zipEntry = zipFile2.getEntry(this.entryName);
      return Util.getCharContents(this, ignoreEncodingErrors, org.eclipse.jdt.internal.compiler.util.Util.getZipEntryByteContent(zipEntry, zipFile2), this.charset.name());
    }
  }
  return null;
}

代码示例来源:origin: org.eclipse.jdt.core.compiler/ecj

@Override
public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException {
  if (getKind() == Kind.SOURCE) {
    try (ZipFile zipFile2 = new ZipFile(this.file)) {
      ZipEntry zipEntry = zipFile2.getEntry(this.entryName);
      return Util.getCharContents(this, ignoreEncodingErrors, org.eclipse.jdt.internal.compiler.util.Util.getZipEntryByteContent(zipEntry, zipFile2), this.charset.name());
    }
  }
  return null;
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.compiler.apt

@Override
public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException {
  if (getKind() == Kind.SOURCE) {
    try (ZipFile zipFile2 = new ZipFile(this.file)) {
      ZipEntry zipEntry = zipFile2.getEntry(this.entryName);
      return Util.getCharContents(this, ignoreEncodingErrors, org.eclipse.jdt.internal.compiler.util.Util.getZipEntryByteContent(zipEntry, zipFile2), this.charset.name());
    }
  }
  return null;
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/ecj

@Override
public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException {
  if (getKind() == Kind.SOURCE) {
    try (ZipFile zipFile2 = new ZipFile(this.file)) {
      ZipEntry zipEntry = zipFile2.getEntry(this.entryName);
      return Util.getCharContents(this, ignoreEncodingErrors, org.eclipse.jdt.internal.compiler.util.Util.getZipEntryByteContent(zipEntry, zipFile2), this.charset.name());
    }
  }
  return null;
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/ecj

@Override
public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException {
  if (getKind() == Kind.SOURCE) {
    try (ZipFile zipFile2 = new ZipFile(this.file)) {
      ZipEntry zipEntry = zipFile2.getEntry(this.entryName);
      return Util.getCharContents(this, ignoreEncodingErrors, org.eclipse.jdt.internal.compiler.util.Util.getZipEntryByteContent(zipEntry, zipFile2), this.charset.name());
    }
  }
  return null;
}

代码示例来源:origin: org.eclipse.jetty.orbit/org.eclipse.jdt.core

@Override
public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException {
  if (getKind() == Kind.SOURCE) {
    return Util.getCharContents(this, ignoreEncodingErrors, org.eclipse.jdt.internal.compiler.util.Util.getZipEntryByteContent(this.zipEntry, this.zipFile), this.charset.name());
  }
  return null;
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7

public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException {
  if (getKind() == Kind.SOURCE) {
    return Util.getCharContents(this, ignoreEncodingErrors, org.eclipse.jdt.internal.compiler.util.Util.getZipEntryByteContent(this.zipEntry, this.zipFile), this.charset.toString());
  }
  return null;
}

代码示例来源:origin: org.eclipse.jetty.orbit/org.eclipse.jdt.core

public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException {
  if (getKind() == Kind.SOURCE) {
    return Util.getCharContents(this, ignoreEncodingErrors, org.eclipse.jdt.internal.compiler.util.Util.getZipEntryByteContent(this.zipEntry, this.zipFile), this.charset.name());
  }
  return null;
}

代码示例来源:origin: org.eclipse.jdt.compiler/apt

public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException {
  if (getKind() == Kind.SOURCE) {
    return Util.getCharContents(this, ignoreEncodingErrors, org.eclipse.jdt.internal.compiler.util.Util.getZipEntryByteContent(this.zipEntry, this.zipFile), this.charset.name());
  }
  return null;
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7

public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException {
  if (getKind() == Kind.SOURCE) {
    return Util.getCharContents(this, ignoreEncodingErrors, org.eclipse.jdt.internal.compiler.util.Util.getZipEntryByteContent(this.zipEntry, this.zipFile), this.charset.toString());
  }
  return null;
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

public static ClassFileReader read(
  java.util.zip.ZipFile zip,
  String filename,
  boolean fullyInitialize)
  throws ClassFormatException, java.io.IOException {
  java.util.zip.ZipEntry ze = zip.getEntry(filename);
  if (ze == null)
    return null;
  byte classFileBytes[] = Util.getZipEntryByteContent(ze, zip);
  ClassFileReader classFileReader = new ClassFileReader(classFileBytes, filename.toCharArray());
  if (fullyInitialize) {
    classFileReader.initialize();
  }
  return classFileReader;
}

代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core

public static ClassFileReader read(
  java.util.zip.ZipFile zip,
  String filename,
  boolean fullyInitialize)
  throws ClassFormatException, java.io.IOException {
  java.util.zip.ZipEntry ze = zip.getEntry(filename);
  if (ze == null)
    return null;
  byte classFileBytes[] = Util.getZipEntryByteContent(ze, zip);
  ClassFileReader classFileReader = new ClassFileReader(classFileBytes, filename.toCharArray());
  if (fullyInitialize) {
    classFileReader.initialize();
  }
  return classFileReader;
}

代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

public static ClassFileReader read(
  java.util.zip.ZipFile zip,
  String filename,
  boolean fullyInitialize)
  throws ClassFormatException, java.io.IOException {
  java.util.zip.ZipEntry ze = zip.getEntry(filename);
  if (ze == null)
    return null;
  byte classFileBytes[] = Util.getZipEntryByteContent(ze, zip);
  ClassFileReader classFileReader = new ClassFileReader(classFileBytes, filename.toCharArray());
  if (fullyInitialize) {
    classFileReader.initialize();
  }
  return classFileReader;
}

代码示例来源:origin: org.eclipse.jdt.core.compiler/ecj

public static ClassFileReader read(
  java.util.zip.ZipFile zip,
  String filename,
  boolean fullyInitialize)
  throws ClassFormatException, java.io.IOException {
  java.util.zip.ZipEntry ze = zip.getEntry(filename);
  if (ze == null)
    return null;
  byte classFileBytes[] = Util.getZipEntryByteContent(ze, zip);
  ClassFileReader classFileReader = new ClassFileReader(classFileBytes, filename.toCharArray());
  if (fullyInitialize) {
    classFileReader.initialize();
  }
  return classFileReader;
}

相关文章