public boolean isValidFrame ( final UnsafeBuffer buffer , final int length ) { boolean isFrameValid = true ; if ( frameVersion ( buffer , 0 ) != HeaderFlyweight . CURRENT_VERSION ) { isFrameValid = false ; invalidPackets . increment ( ) ; } else if ( length < HeaderFlyweight . MIN_HEADER_LENGTH ) { isFrameValid = false ; invalidPackets . increment ( ) ; } return isFrameValid ; }
Is the received frame valid . This method will do some basic checks on the header and can be overridden in a subclass for further validation .