aboutsip / pkts

Pure java based pcap library capable of reading and writing to/from pcaps.
Other
198 stars 92 forks source link

Length is larger than buffer. Request=1226842144, capacity=262144 #124

Open doctorbean opened 4 years ago

doctorbean commented 4 years ago

Exception in thread "main" java.lang.IllegalArgumentException: Length is larger than buffer. Request=1226842144, capacity=262144 at io.pkts.buffer.BoundedInputStreamBuffer.internalReadBytes(BoundedInputStreamBuffer.java:171) at io.pkts.buffer.BoundedInputStreamBuffer.readBytes(BoundedInputStreamBuffer.java:131) at io.pkts.framer.PcapFramer.frame(PcapFramer.java:66) at io.pkts.Pcap.loop(Pcap.java:79) at io.pkts.examples.streams.StreamsExample001.main(StreamsExample001.java:77)

what can I do ?

jonbo372 commented 4 years ago

Hi,

Currently, the only thing you can do is either to change the capacity and rebuild the project. I've been meaning to change the way pcaps are read so that you can read an infinite size (in short, read one frame a time and then throw it away once processed and as such, do not allocate a massive buffer for the entire pcap). However, pretty sure I will not get to that anytime soon but pull requests are welcome! :-)

/Jonas