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

com.bytezone.dm3270.replyfield.RPQNames 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.15-lib
Show newest version
package com.bytezone.dm3270.replyfield;

import com.bytezone.dm3270.Charset;
import com.bytezone.dm3270.buffers.Buffer;

public class RPQNames extends QueryReplyField {

  private String deviceType;
  private long model;
  private String rpqName;

  public RPQNames(byte[] buffer, Charset charset) {
    super(buffer);
    assert data[1] == RPQ_NAMES_REPLY;

    deviceType = charset.getString(data, 2, 4);
    model = Buffer.unsignedLong(data, 6);
    int len = (data[10] & 0xFF) - 1;
    if (len > 0) {
      rpqName = charset.getString(data, 11, len);
    } else {
      rpqName = "";
    }
  }

  @Override
  public String toString() {
    return super.toString() + String.format("%n  device     : %s", deviceType)
        + String.format("%n  model      : %d", model)
        + String.format("%n  RPQ name   : %s", rpqName);
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy