whitespace = width = 0;
whitespace = 0; width = 0;
	private String doTab(String in, int tabSize)	{		StringBuffer buf = new StringBuffer();		for(int i = 0, width = 0, whitespace = 0;			i < in.length(); i++, width++)		{			switch(in.charAt(i))			{			case ' ':				whitespace++;				break;			case '\t':				int tab = tabSize - (width % tabSize);				width += tab;				whitespace += tab;				break;			case '\n':				whitespace = width = 0;				buf.append('\n');				break;			default:				if(whitespace != 0)				{					if(whitespace >= tabSize / 2)					{						int indent = whitespace +							((width-whitespace)							% tabSize);						int tabs = indent / tabSize;						int spaces = indent % tabSize;						while(tabs-- > 0)							buf.append('\t');						while(spaces-- > 0)							buf.append(' ');					}					else					{						while(whitespace-- > 0)							buf.append(' ');					}					whitespace = 0;				}				buf.append(in.charAt(i));				break;			}		}	                return buf.toString();	}