code: public static Pcap openStream(final InputStream is, final int bufferCapacity) throws IOException {
          final Buffer stream = new BoundedInputStreamBuffer(bufferCapacity, is);
          final PcapGlobalHeader header = PcapGlobalHeader.parse(stream);
          return new Pcap(header, stream);
      }
docs: Capture packets from the input stream
  
  @param is
  @param bufferCapacity Size of buffer, must be larger than PCAPs largest framesize. See SNAPLENGTH for tcpdump, et.al.
  @return
  @throws IOException