org.xbill.DNS.Record.fromWire()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(4.1k)|赞(0)|评价(0)|浏览(109)

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

Record.fromWire介绍

暂无

代码示例

代码示例来源:origin: tiandawu/IotXmpp

static Record
fromWire(DNSInput in, int section) throws IOException {
  return fromWire(in, section, false);
}

代码示例来源:origin: dnsjava/dnsjava

static Record
fromWire(DNSInput in, int section) throws IOException {
  return fromWire(in, section, false);
}

代码示例来源:origin: net.sf.dnsjava-osgi/dnsjava-osgi

static Record
fromWire(DNSInput in, int section) throws IOException {
  return fromWire(in, section, false);
}

代码示例来源:origin: org.littleshoot/dnsjava

static Record
fromWire(DNSInput in, int section) throws IOException {
  return fromWire(in, section, false);
}

代码示例来源:origin: dnsjava/dnsjava

/**
 * Builds a Record from DNS uncompressed wire format.
 */
public static Record
fromWire(byte [] b, int section) throws IOException {
  return fromWire(new DNSInput(b), section, false);
}

代码示例来源:origin: tiandawu/IotXmpp

/**
 * Builds a Record from DNS uncompressed wire format.
 */
public static Record
fromWire(byte [] b, int section) throws IOException {
  return fromWire(new DNSInput(b), section, false);
}

代码示例来源:origin: net.sf.dnsjava-osgi/dnsjava-osgi

/**
 * Builds a Record from DNS uncompressed wire format.
 */
public static Record
fromWire(byte [] b, int section) throws IOException {
  return fromWire(new DNSInput(b), section, false);
}

代码示例来源:origin: org.littleshoot/dnsjava

/**
 * Builds a Record from DNS uncompressed wire format.
 */
public static Record
fromWire(byte [] b, int section) throws IOException {
  return fromWire(new DNSInput(b), section, false);
}

代码示例来源:origin: net.sf.dnsjava-osgi/dnsjava-osgi

Message(DNSInput in) throws IOException {
  this(new Header(in));
  boolean isUpdate = (header.getOpcode() == Opcode.UPDATE);
  boolean truncated = header.getFlag(Flags.TC);
  try {
    for (int i = 0; i < 4; i++) {
      int count = header.getCount(i);
      if (count > 0)
        sections[i] = new ArrayList(count);
      for (int j = 0; j < count; j++) {
        int pos = in.current();
        Record rec = Record.fromWire(in, i, isUpdate);
        sections[i].add(rec);
        if (rec.getType() == Type.TSIG)
          tsigstart = pos;
      }
    }
  } catch (WireParseException e) {
    if (!truncated)
      throw e;
  }
  size = in.current();
}

代码示例来源:origin: org.littleshoot/dnsjava

Message(DNSInput in) throws IOException {
  this(new Header(in));
  boolean isUpdate = (header.getOpcode() == Opcode.UPDATE);
  boolean truncated = header.getFlag(Flags.TC);
  try {
    for (int i = 0; i < 4; i++) {
      int count = header.getCount(i);
      if (count > 0)
        sections[i] = new ArrayList(count);
      for (int j = 0; j < count; j++) {
        int pos = in.current();
        Record rec = Record.fromWire(in, i, isUpdate);
        sections[i].add(rec);
        if (rec.getType() == Type.TSIG)
          tsigstart = pos;
        if (rec.getType() == Type.SIG &&
          ((SIGRecord) rec).getTypeCovered() == 0)
          sig0start = pos;
      }
    }
  } catch (WireParseException e) {
    if (!truncated)
      throw e;
  }
  size = in.current();
}

代码示例来源:origin: tiandawu/IotXmpp

for (int j = 0; j < count; j++) {
  int pos = in.current();
  Record rec = Record.fromWire(in, i, isUpdate);
  sections[i].add(rec);
  if (i == Section.ADDITIONAL) {

代码示例来源:origin: dnsjava/dnsjava

for (int j = 0; j < count; j++) {
  int pos = in.current();
  Record rec = Record.fromWire(in, i, isUpdate);
  sections[i].add(rec);
  if (i == Section.ADDITIONAL) {

代码示例来源:origin: DirectProject/nhin-d

/**
   * Converts a raw wire transfer format of a record to a DNS record.
   * @param data  The raw byte stream of a record in wire transfer format.
   * @return A DNSRecord converted from the wire format.
   * @throws IOException
   */
  public static DNSRecord fromWire(byte[] data) throws IOException
  {
    Record rec = Record.fromWire(data, Section.ANSWER);
    
    DNSRecord retVal = new DNSRecord();
    
    retVal.setDclass(rec.getDClass());
    retVal.setName(rec.getName().toString());
    retVal.setData(rec.rdataToWireCanonical());
    retVal.setTtl(rec.getTTL());
    retVal.setType(rec.getType());
    
    return retVal;
  }    
}

代码示例来源:origin: DirectProject/nhin-d

/**
   * Converts a raw wire transfer format of a record to a DNS record.
   * @param data  The raw byte stream of a record in wire transfer format.
   * @return A DNSRecord converted from the wire format.
   * @throws IOException
   */
  public static DNSRecord fromWire(byte[] data) throws IOException
  {
    Record rec = Record.fromWire(data, Section.ANSWER);
    
    DNSRecord retVal = new DNSRecord();
    
    retVal.setDclass(rec.getDClass());
    retVal.setName(rec.getName().toString());
    retVal.setData(rec.rdataToWireCanonical());
    retVal.setTtl(rec.getTTL());
    retVal.setType(rec.getType());
    
    return retVal;
  }    
}

相关文章