gpt4 book ai didi

at.o2xfs.win32.ZList类的使用及代码示例

转载 作者:知者 更新时间:2024-03-18 05:33:31 27 4
gpt4 key购买 nike

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

ZList介绍

[英]ZList A class representing a null-terminated list of pointers.
[中]ZList表示以null结尾的指针列表的类。

代码示例

代码示例来源:origin: AndreasFagschlunger/O2Xfs

public static <T> List<T> fromNullTerminatedArray(XfsVersion xfsVersion, Pointer p, Class<T> type) {
    List<T> result = new ArrayList<>();
    for (Pointer each : new ZList(p)) {
      result.add(create(xfsVersion, each, type));
    }
    return Collections.unmodifiableList(result);
  }
}

代码示例来源:origin: AndreasFagschlunger/O2Xfs

public <T extends Type> ZList(List<T> types) {
  for (int i = 0; i < types.size(); i++) {
    pointers.add(new Pointer());
  }
  allocate();
  int offset = 0;
  for (int i = 0; i < types.size(); i++) {
    Pointer p = pointers.get(i);
    p.assignBuffer(getBuffer().subBuffer(offset, p.getSize()));
    p.pointTo(types.get(i));
    offset += p.getSize();
  }
}

代码示例来源:origin: AndreasFagschlunger/O2Xfs

public ZList(Pointer pointer) {
  int offset = 0;
  Buffer buffer = null;
  while (true) {
    buffer = pointer.buffer(offset + pointer.getSize());
    Pointer p = new Pointer(buffer.subBuffer(offset, pointer.getSize()));
    if (Pointer.NULL.equals(p)) {
      break;
    }
    pointers.add(p);
    offset += p.getSize();
  }
  assignBuffer(buffer);
}

代码示例来源:origin: AndreasFagschlunger/O2Xfs

@Override
  protected ReadImageCompleteEvent createCompleteEvent(Pointer results) {
    final String method = "createCompleteEvent(Pointer)";
    List<Image3> images = new ArrayList<Image3>();
    ZList list = new ZList(results);
    for (Pointer p : list) {
      Image3 image = PtrFactory.INSTANCE.create(ptrService.getXfsVersion(), p, Image3.class);
      if (LOG.isDebugEnabled()) {
        LOG.debug(method, "image=" + image);
      }
      images.add(image);
    }
    return new ReadImageCompleteEvent(images);
  }
}

代码示例来源:origin: AndreasFagschlunger/O2Xfs

@Override
  public Collection<CurrencyExp3> call() throws XfsException {
    List<CurrencyExp3> result;
    XfsInfoCommand<CdmInfoCommand> infoCommand = new XfsInfoCommand<CdmInfoCommand>(service, CdmInfoCommand.CURRENCY_EXP);
    WFSResult wfsResult = null;
    try {
      wfsResult = infoCommand.call();
      result = new ArrayList<>();
      ZList lppCurrencyExp = new ZList(wfsResult.getResults());
      for (Pointer p : lppCurrencyExp) {
        result.add(ReflectiveFactory.create(service.getXfsVersion(), p, CurrencyExp3.class));
      }
    } finally {
      if (wfsResult != null) {
        XfsServiceManager.getInstance().free(wfsResult);
      }
    }
    return Collections.unmodifiableList(result);
  }
}

代码示例来源:origin: AndreasFagschlunger/O2Xfs

@Test
public final void test() {
  ZList currencyExp3 = new ZList(buildCurrencyExp3().getPointer());
  for (Pointer each : currencyExp3) {
    CurrencyExp3 expected = new CurrencyExp3(each);
    CurrencyExp3 actual = new CurrencyExp3(expected);
    System.out.println(actual);
    assertEquals(expected, actual);
  }
}

代码示例来源:origin: AndreasFagschlunger/O2Xfs

@Test
public final void test() {
  ZList lppMixTypes = new ZList(buildMixTypes3().getPointer());
  for (Pointer each : lppMixTypes) {
    MixType3 expected = new MixType3(each);
    MixType3 actual = new MixType3(expected);
    System.out.println(actual);
    assertEquals(expected, actual);
  }
}

代码示例来源:origin: AndreasFagschlunger/O2Xfs

@Override
  public void fireOperationCompleteEvent(final WFSResult wfsResult) {
    final String method = "fireOperationCompleteEvent(WFSResult)";
    try {
      if (LOG.isDebugEnabled()) {
        LOG.debug(method, "wfsResult=" + wfsResult);
      }
      XfsException.throwFor(wfsResult.getResult());
      final List<CardData3> cardDataList = new ArrayList<CardData3>();
      final ZList zList = new ZList(wfsResult.getResults());
      for (final Pointer pCardData : zList) {
        final CardData3 cardData = IdcFactory.create(idcService.getXfsVersion(), pCardData, CardData3.class);
        if (LOG.isDebugEnabled()) {
          LOG.debug(method, "cardData=" + cardData);
        }
        cardDataList.add(cardData);
      }
      notifyCardRead(cardDataList);
      notifyCommandSuccessful();
    } catch (XfsCancelledException e) {
      notifyCommandCancelled();
    } catch (XfsException e) {
      notifyCommandFailed(e);
    } finally {
      serviceManager.free(wfsResult);
    }
  }
}

代码示例来源:origin: AndreasFagschlunger/O2Xfs

@Test
public void keyDetail() throws Exception {
  for (final PINService pinService : serviceManager.getServices(PINService.class)) {
    final XfsCommand xfsCommand = new XfsInfoCommand<PINInfoCommand>(pinService, PINInfoCommand.KEY_DETAIL);
    WFSResult wfsResult = null;
    try {
      wfsResult = xfsCommand.call();
      ZList pKeyDetails = new ZList(wfsResult.getResults());
      for (Pointer pKeyDetail : pKeyDetails) {
        WFSPINKEYDETAIL keyDetail = new WFSPINKEYDETAIL(pinService.getXfsVersion(), pKeyDetail);
        System.out.println(keyDetail);
      }
    } finally {
      if (wfsResult != null) {
        serviceManager.free(wfsResult);
      }
    }
  }
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com