@Override
	public void write(char[] c, int off, int len) throws IOException{
		if(closed){
			throw new IllegalStateException();
		}
		if (off < 0 || off > c.length || len < 0 ||
				off + len > c.length || off + len < 0) {
			throw new IndexOutOfBoundsException();
		}
		synchronized(lock){
			char[] buf = new char[len];
			System.arraycopy(c, off, buf, 0, len);
			String string = String.copyValueOf(buf);
			buff += string;
			if(string.contains("\n")){
				flush();
			}
		}
	}