i'm writing a program to open a pcap file and then filter some packets and then write packet data as string in a file but i do nott know why this progrme is doing nothing after opening the pcap file.
int rtsp=0;
FileWriter fstream2= new FileWriter("E:\write2.txt",true);
BufferedWriter fbw2= new BufferedWriter(fstream2);
System.out.println("RTSP:"); JpcapCaptor captor2=JpcapCaptor.openFile("E:\rtsp_with_data_over_tcp.pcap");
while(true){
Packet packet2=captor2.getPacket();
if(packet2==null || packet2==Packet.EOF) break;
rtsp=rtsp+1; String PacketData2=new String(packet2.data);
fbw2.write(PacketData2);
fbw2.newLine();
}
fbw2.close();
captor2.close();
System.out.println("RTSP:"+rtsp);
EVEN this last print statement is also not working.
can any one guide me? !