package ru.aserdyuchenko;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;
import java.io.IOException;
import org.apache.commons.io.IOUtils;

/**
 * Class InputOutput.
 * @author Anton Serdyuchenko (anton415@gmail.com)
 * @version $Id$
 * @since 0.1
 */
public class FiveLetters {
/**
 * @param result - result.
 */
	private boolean result = false;
/**
 * convertStreamToInt method.
 * @param in - Scanner.
 * @throws IOException - IOException.
 * @return result - result checking.
 */
	public boolean checkWord(InputStream in) throws IOException {
		try (BufferedReader reader = new BufferedReader(new InputStreamReader(in))) {
			try {
				char[] array = (IOUtils.toString(reader)).toCharArray();
				for (int x = array.length - 1; x >= 0; x--) {
					for (int y = 0; y <= array.length - 1; y++) {
						if (Character.toUpperCase(array[x]) == Character.toUpperCase(array[y])) {
							result = true;
						} else {
							result = false;
						}
						x--;
					}
				}
			} catch (NumberFormatException e) {
        		result = false;
    		}
		}
		return result;
	}

/**
 * @param value - word for checking.
 * @return result - result checking.
 */
	public boolean isPalidrom(String value) {
		boolean result = false;
		char[] array = value.toCharArray();
		char[] palidrom = new char[value.length()];
		int indexForPalidrom = 0;
		for (int index = array.length - 1; index >= 0; index--) {
			palidrom[indexForPalidrom] = array[index];
			indexForPalidrom++;
		}
		String word = String.valueOf(palidrom);
		if ((word.toUpperCase()).equals(value.toUpperCase())) {
			result = true;
		}
		return result;
	}
}

@@ -1303,99 +1303,37 @@
 ;%0A%09%09
-char%5B%5D palidrom = new char%5Bvalue.length()%5D;%0A%09%09int indexForPalidrom = 0;%0A%09%09for (int
+for (int index = 0;
  index 
-= 
+%3C (
 arra
@@ -1348,206 +1348,158 @@
  - 1
+)
 ; index
- %3E= 0; index--) %7B%0A%09%09%09palidrom%5BindexForPalidrom%5D = array%5Bindex%5D;%0A%09%09%09indexForPalidrom++;%0A%09%09%7D%0A%09%09String word
+++) %7B%0A%09%09%09if (Character.toUpperCase(array%5Bindex%5D) == Character.toUpperCase(array%5Barray.length - index - 1%5D)) %7B%0A%09%09%09%09result
  = 
-S
 tr
-ing.valueOf(palidrom);%0A%09%09if ((word.toUpperCase()).equals(value.toUpperCase()))
+ue;%0A%09%09%09%7D else
  %7B%0A
+%09
 %09%09%09r
@@ -1506,21 +1506,38 @@
 esult = 
-true;
+false;%0A%09%09%09%09break;%0A%09%09%09%7D
 %0A%09%09%7D%0A%09%09r

Edit class FileLetters.java