Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
jNetPcap でこの関数をオーバーロードする方法を探しています。
Pcap openOffline(String fname, StringBuilder errbuf);
私はこの方法でそれを実装したい:
Pcap openOffline(InputStraem stream, StringBuilder errbuf);
ソース コードをダウンロードしましたが、この関数は関数ですnative。この関数の実装にアクセスして変更するにはどうすればよいですか?
native
メソッドを静的として宣言し、メソッド内から元のネイティブ メソッドを呼び出すことができます。
何かのようなもの
static Pcap openOffline(InputStream stream, StringBuilder errbuf) { String fname; doSomeThing(); //Extract a string from the inputstream and store it in fname return openOffline(fname, errbuf); }