CopyListingFileStatus.java 文件源码

java
阅读 23 收藏 0 点赞 0 评论 0

项目:circus-train 作者:
@Override
public void readFields(DataInput in) throws IOException {
  super.readFields(in);
  byte aclEntriesSize = in.readByte();
  if (aclEntriesSize != NO_ACL_ENTRIES) {
    aclEntries = Lists.newArrayListWithCapacity(aclEntriesSize);
    for (int i = 0; i < aclEntriesSize; ++i) {
      aclEntries.add(new AclEntry.Builder()
          .setScope(ACL_ENTRY_SCOPES[in.readByte()])
          .setType(ACL_ENTRY_TYPES[in.readByte()])
          .setName(WritableUtils.readString(in))
          .setPermission(FS_ACTIONS[in.readByte()])
          .build());
    }
  } else {
    aclEntries = null;
  }

  int xAttrsSize = in.readInt();
  if (xAttrsSize != NO_XATTRS) {
    xAttrs = Maps.newHashMap();
    for (int i = 0; i < xAttrsSize; ++i) {
      final String name = WritableUtils.readString(in);
      final int valueLen = in.readInt();
      byte[] value = null;
      if (valueLen > -1) {
        value = new byte[valueLen];
        if (valueLen > 0) {
          in.readFully(value);
        }
      }
      xAttrs.put(name, value);
    }
  } else {
    xAttrs = null;
  }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号