marine-api
marine-api copied to clipboard
Make AIS length validation less restricted
Hi, would it be possible to make the AIS length validation less restricted or configurable? Due to tests with different AIS sources we noticed that sometimes that it is required to increase the maximum length.
Best regards
Hi @qtran, could you give some example cases?
I faced this problem too.
Seems that it hardcoded: As example in AISPositionReportParser.java:
if (content.length() != 168) throw new IllegalArgumentException("Wrong message length");
Please provide more context and sample data - or preferrably a pull-request proposing a fix.
Regarding the hard-coded value, it is according the AIS specification where the length of both A and B reports is 168: