All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.bytezone.dm3270.replyfield.DistributedDataManagement Maven / Gradle / Ivy

Go to download

This is a trimmed down version of https://github.com/dmolony/dm3270 to be used as TN3270 client library

There is a newer version: 0.9.1
Show newest version
package com.bytezone.dm3270.replyfield;

import com.bytezone.dm3270.utilities.Dm3270Utility;

public class DistributedDataManagement extends QueryReplyField {

  private int flags;
  private int limitIn;
  private int limitOut;
  private int subsets;
  private byte ddmSubset;

  public DistributedDataManagement(byte[] buffer) {
    super(buffer);
    assert data[1] == DISTRIBUTED_DATA_MANAGEMENT_REPLY;

    flags = Dm3270Utility.unsignedShort(data, 2);
    limitIn = Dm3270Utility.unsignedShort(data, 4);
    limitOut = Dm3270Utility.unsignedShort(data, 6);
    subsets = data[8] & 0xFF;
    ddmSubset = data[9];

    int ptr = 10;
    while (ptr < data.length) {
      int len = data[ptr] & 0xFF;
      ptr += len;
    }
  }

  @Override
  public String toString() {
    return super.toString() + String.format("%n  flags      : %04X", flags)
        + String.format("%n  limit in   : %s", limitIn)
        + String.format("%n  limit out  : %s", limitOut)
        + String.format("%n  subsets    : %s", subsets)
        + String.format("%n  DDMSS      : %s", ddmSubset);
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy