public static byte[] unPad(byte[] seq,boolean forward){
  if (seq != null && seq.length == CG2_PADDED_LENGTH) {
    final int pos=forward ? CG2_PAD_POSITION : CG2_PAD_POSITION_REV;
    final byte[] result=new byte[seq.length - 1];
    System.arraycopy(seq,0,result,0,pos);
    System.arraycopy(seq,pos + 1,result,pos,seq.length - pos - 1);
    return result;
  }
 else {
    return seq;
  }
}

public static byte [ ] unPad ( byte [ ] seq , boolean forward ) { if ( seq != null && seq . length == CG2_PADDED_LENGTH ) { final int pos = forward ? CG2_PAD_POSITION : CG2_PAD_POSITION_REV ; final byte [ ] result = new byte [ seq . length - 1 ] ; System . arraycopy ( seq , 0 , result , 0 , pos ) ; System . arraycopy ( seq , pos + 1 , result , pos , seq . length - pos - 1 ) ; return result ; } else { return seq ; } }
strip single padding base that complete genomics v2 reads contain , if present .
