private final int filterStatusBytes(byte[] src,byte[] dest,int totalBytesRead,int maxPacketSize){
  final int packetsCount=totalBytesRead / maxPacketSize + (totalBytesRead % maxPacketSize == 0 ? 0 : 1);
  for (int packetIdx=0; packetIdx < packetsCount; ++packetIdx) {
    final int count=(packetIdx == (packetsCount - 1)) ? (totalBytesRead % maxPacketSize) - MODEM_STATUS_HEADER_LENGTH : maxPacketSize - MODEM_STATUS_HEADER_LENGTH;
    if (count > 0) {
      System.arraycopy(src,packetIdx * maxPacketSize + MODEM_STATUS_HEADER_LENGTH,dest,packetIdx * (maxPacketSize - MODEM_STATUS_HEADER_LENGTH),count);
    }
  }
  return totalBytesRead - (packetsCount * 2);
}

private final int filterStatusBytes ( byte [ ] src , byte [ ] dest , int totalBytesRead , int maxPacketSize ) { final int packetsCount = totalBytesRead / maxPacketSize + ( totalBytesRead % maxPacketSize == 0 ? 0 : 1 ) ; for ( int packetIdx = 0 ; packetIdx < packetsCount ; ++ packetIdx ) { final int count = ( packetIdx == ( packetsCount - 1 ) ) ? ( totalBytesRead % maxPacketSize ) - MODEM_STATUS_HEADER_LENGTH : maxPacketSize - MODEM_STATUS_HEADER_LENGTH ; if ( count > 0 ) { System . arraycopy ( src , packetIdx * maxPacketSize + MODEM_STATUS_HEADER_LENGTH , dest , packetIdx * ( maxPacketSize - MODEM_STATUS_HEADER_LENGTH ) , count ) ; } } return totalBytesRead - ( packetsCount * 2 ) ; }
filter ftdi status bytes from buffer
