I m doing packet capturing in my project, for which i hav entended my Java API to Jpcap. I m able to capture packets and they are displayed on Command line. Now i need to save those packets in a file. File is getting created but when i start to write packets in the file it gives a EXCEPTION_ACCESS_VIOLATION (0xc0000005) and some garbage value is written into da file.