class PcapHandle implements Closeable {

  public void setDlt(DataLinkType dlt) throws PcapNativeException, NotOpenException {
    if (dlt == null) {
      throw new NullPointerException("dlt must not be null.");
    }
    if (!open) {
      throw new NotOpenException();
    }

    if (!handleLock.readLock().tryLock()) {
      throw new NotOpenException();
    }
    try {
      if (!open) {
        throw new NotOpenException();
      }

      int rc = NativeMappings.pcap_set_datalink(handle, dlt.value());
      if (rc < 0) {
        throw new PcapNativeException(getError(), rc);
      }
    } finally {
      handleLock.readLock().unlock();
    }

    this.dlt = dlt;
  }

    PcapHandle(Pointer handle, TimestampPrecision timestampPrecision);
  private  PcapHandle(Builder builder);

}