Convert integer value to matching Java Enum
<p>I've an enum like this:</p>

<pre><code>public enum PcapLinkType {
  DLT_NULL(0)
  DLT_EN10MB(1)
  DLT_EN3MB(2),
  DLT_AX25(3),
  /*snip, 200 more enums, not always consecutive.*/
  DLT_UNKNOWN(-1);
    private final int value;   

    PcapLinkType(int value) {
        this.value= value;
    }
}
</code></pre>

<p>Now I get an int from external input and want the matching input - throwing an exception if a  value does not exist is ok, but preferably I'd have it be <code>DLT_UNKNOWN</code>  in that case.</p>

<pre><code>int val = in.readInt();
PcapLinkType type = ???; /*convert val to a PcapLinkType */
</code></pre>
