org.apache.commons.compress.archivers.zip.ZipUtil.unsignedIntToSignedByte()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(2.9k)|赞(0)|评价(0)|浏览(77)

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

ZipUtil.unsignedIntToSignedByte介绍

[英]Converts an unsigned integer to a signed byte (e.g., 255 becomes -1).
[中]将无符号整数转换为有符号字节(例如,255变为-1)。

代码示例

代码示例来源:origin: org.apache.commons/commons-compress

/**
 * Returns a String representation of this class useful for
 * debugging purposes.
 *
 * @return A String representation of this class useful for
 *         debugging purposes.
 */
@Override
public String toString() {
  final StringBuilder buf = new StringBuilder();
  buf.append("0x5455 Zip Extra Field: Flags=");
  buf.append(Integer.toBinaryString(ZipUtil.unsignedIntToSignedByte(flags))).append(" ");
  if (bit0_modifyTimePresent && modifyTime != null) {
    final Date m = getModifyJavaTime();
    buf.append(" Modify:[").append(m).append("] ");
  }
  if (bit1_accessTimePresent && accessTime != null) {
    final Date a = getAccessJavaTime();
    buf.append(" Access:[").append(a).append("] ");
  }
  if (bit2_createTimePresent && createTime != null) {
    final Date c = getCreateJavaTime();
    buf.append(" Create:[").append(c).append("] ");
  }
  return buf.toString();
}

代码示例来源:origin: org.apache.commons/commons-compress

data[pos++] = unsignedIntToSignedByte(version);
data[pos++] = unsignedIntToSignedByte(uidBytesLen);
if (uidBytes != null) {
  System.arraycopy(uidBytes, 0, data, pos, uidBytesLen);
data[pos++] = unsignedIntToSignedByte(gidBytesLen);
if (gidBytes != null) {
  System.arraycopy(gidBytes, 0, data, pos, gidBytesLen);

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

/**
 * Returns a String representation of this class useful for
 * debugging purposes.
 *
 * @return A String representation of this class useful for
 *         debugging purposes.
 */
@Override
public String toString() {
  final StringBuilder buf = new StringBuilder();
  buf.append("0x5455 Zip Extra Field: Flags=");
  buf.append(Integer.toBinaryString(ZipUtil.unsignedIntToSignedByte(flags))).append(" ");
  if (bit0_modifyTimePresent && modifyTime != null) {
    final Date m = getModifyJavaTime();
    buf.append(" Modify:[").append(m).append("] ");
  }
  if (bit1_accessTimePresent && accessTime != null) {
    final Date a = getAccessJavaTime();
    buf.append(" Access:[").append(a).append("] ");
  }
  if (bit2_createTimePresent && createTime != null) {
    final Date c = getCreateJavaTime();
    buf.append(" Create:[").append(c).append("] ");
  }
  return buf.toString();
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

data[pos++] = unsignedIntToSignedByte(version);
data[pos++] = unsignedIntToSignedByte(uidBytesLen);
if (uidBytes != null) {
  System.arraycopy(uidBytes, 0, data, pos, uidBytesLen);
data[pos++] = unsignedIntToSignedByte(gidBytesLen);
if (gidBytes != null) {
  System.arraycopy(gidBytes, 0, data, pos, gidBytesLen);

相关文章