Here you can find the source of endsWithGaps(final byte[] aFrag, final int numEndGaps)
public static boolean endsWithGaps(final byte[] aFrag, final int numEndGaps)
//package com.java2s; /*//w w w . j a va 2 s . c o m * Copyright (c) 2007-2013 David Soergel <dev@davidsoergel.com> * Licensed under the Apache License, Version 2.0 * http://www.apache.org/licenses/LICENSE-2.0 */ public class Main { public static boolean endsWithGaps(final byte[] aFrag, final int numEndGaps) { for (int i = 1; i <= numEndGaps; i++) { // if the fragment is shorter than the window but contains only gaps, return true if (i <= 0) { return true; } if (!isGap(aFrag[aFrag.length - i])) { return false; } } return true; } public static boolean isGap(byte x)//, String gapChars) { return x == '-' || x == '.' || x == ' '; // return gapChars.indexOf((char) x) != -1; } }