Exemplo n.º 1
0
  public static boolean checkDataIntegrity(byte[] data, int offset, int expectedNewOffset) {
    int dMonListBinCount = ByteConversions.getIntegerInByteArrayAtPosition(data, offset);
    offset += 4;

    offset += dMonListBinCount * DMONLIST_BIN_RECORD_SIZE;

    return (offset == expectedNewOffset);
  }
Exemplo n.º 2
0
  public static int populateObjects(byte[] data, int offset, List dMonListBinList) {
    int dMonListBinCount = ByteConversions.getIntegerInByteArrayAtPosition(data, offset);
    offset += 4;

    for (int dMonListBinIndex = 0; dMonListBinIndex < dMonListBinCount; ++dMonListBinIndex) {
      DMonListBinMM6 dMonListBin = new DMonListBinMM6();
      dMonListBinList.add(dMonListBin);
      offset = dMonListBin.initialize(data, offset);
    }

    return offset;
  }
Exemplo n.º 3
0
  public static int updateData(byte[] newData, int offset, List dMonListBinList) {
    ByteConversions.setIntegerInByteArrayAtPosition(dMonListBinList.size(), newData, offset);
    offset += 4;

    for (int dMonListBinIndex = 0; dMonListBinIndex < dMonListBinList.size(); ++dMonListBinIndex) {
      DMonListBinMM6 dMonListBin = (DMonListBinMM6) dMonListBinList.get(dMonListBinIndex);
      System.arraycopy(
          dMonListBin.getDMonListBinData(),
          0,
          newData,
          offset,
          dMonListBin.getDMonListBinData().length);
      offset += dMonListBin.getDMonListBinData().length;
    }

    return offset;
  }