class Pcaps {

  public static PcapHandle openOffline(String filePath) throws PcapNativeException {
    if (filePath == null) {
      StringBuilder sb = new StringBuilder();
      sb.append("filePath: ").append(filePath);
      throw new NullPointerException(sb.toString());
    }

    PcapErrbuf errbuf = new PcapErrbuf();
    Pointer handle = NativeMappings.pcap_open_offline(filePath, errbuf);

    if (handle == null || errbuf.length() != 0) {
      throw new PcapNativeException(errbuf.toString());
    }

    return new PcapHandle(handle, TimestampPrecision.MICRO);
  }

  private  Pcaps();

}