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

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

本文整理了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

  1. /**
  2. * Returns a String representation of this class useful for
  3. * debugging purposes.
  4. *
  5. * @return A String representation of this class useful for
  6. * debugging purposes.
  7. */
  8. @Override
  9. public String toString() {
  10. final StringBuilder buf = new StringBuilder();
  11. buf.append("0x5455 Zip Extra Field: Flags=");
  12. buf.append(Integer.toBinaryString(ZipUtil.unsignedIntToSignedByte(flags))).append(" ");
  13. if (bit0_modifyTimePresent && modifyTime != null) {
  14. final Date m = getModifyJavaTime();
  15. buf.append(" Modify:[").append(m).append("] ");
  16. }
  17. if (bit1_accessTimePresent && accessTime != null) {
  18. final Date a = getAccessJavaTime();
  19. buf.append(" Access:[").append(a).append("] ");
  20. }
  21. if (bit2_createTimePresent && createTime != null) {
  22. final Date c = getCreateJavaTime();
  23. buf.append(" Create:[").append(c).append("] ");
  24. }
  25. return buf.toString();
  26. }

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

  1. data[pos++] = unsignedIntToSignedByte(version);
  2. data[pos++] = unsignedIntToSignedByte(uidBytesLen);
  3. if (uidBytes != null) {
  4. System.arraycopy(uidBytes, 0, data, pos, uidBytesLen);
  5. data[pos++] = unsignedIntToSignedByte(gidBytesLen);
  6. if (gidBytes != null) {
  7. System.arraycopy(gidBytes, 0, data, pos, gidBytesLen);

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

  1. /**
  2. * Returns a String representation of this class useful for
  3. * debugging purposes.
  4. *
  5. * @return A String representation of this class useful for
  6. * debugging purposes.
  7. */
  8. @Override
  9. public String toString() {
  10. final StringBuilder buf = new StringBuilder();
  11. buf.append("0x5455 Zip Extra Field: Flags=");
  12. buf.append(Integer.toBinaryString(ZipUtil.unsignedIntToSignedByte(flags))).append(" ");
  13. if (bit0_modifyTimePresent && modifyTime != null) {
  14. final Date m = getModifyJavaTime();
  15. buf.append(" Modify:[").append(m).append("] ");
  16. }
  17. if (bit1_accessTimePresent && accessTime != null) {
  18. final Date a = getAccessJavaTime();
  19. buf.append(" Access:[").append(a).append("] ");
  20. }
  21. if (bit2_createTimePresent && createTime != null) {
  22. final Date c = getCreateJavaTime();
  23. buf.append(" Create:[").append(c).append("] ");
  24. }
  25. return buf.toString();
  26. }

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

  1. data[pos++] = unsignedIntToSignedByte(version);
  2. data[pos++] = unsignedIntToSignedByte(uidBytesLen);
  3. if (uidBytes != null) {
  4. System.arraycopy(uidBytes, 0, data, pos, uidBytesLen);
  5. data[pos++] = unsignedIntToSignedByte(gidBytesLen);
  6. if (gidBytes != null) {
  7. System.arraycopy(gidBytes, 0, data, pos, gidBytesLen);

相关文章