public static void format(InStream inStream, OutStream outStream,FormatSettings formatSettings) throws IOException, ClassNotFoundException, IllegalAccessException, InstantiationException {
        indentString = formatSettings.getIndentString();
        char currentSymbol;
        handlers = formatSettings.getHandlersList();
        while (true) {
            pastHandlers = 0;
            currentSymbol = inStream.readSymbol();
            if (inStream.isEnd()) break;
            if (indent == true){
                for (int j = 0; j < indentLevel; j++) {
                    outStream.writeString(indentString);
                }
            }
            for (int i = 0; i < handlers.size(); i++) {
                if (handlers.get(i).canDo(currentSymbol)){
                    handlers.get(i).action(outStream);
                    break;
                }
                pastHandlers++;
            }
            if (pastHandlers ==  handlers.size()){
                outStream.writeSymbol(currentSymbol);
                indent = false;
                isNewLine = false;
            }
        }
    }