protected int readData( char[] chunkData, int pos )
	{
		int state = 0;
		int start = pos;
		StringBuilder sb = new StringBuilder();
        while ( pos < chunkData.length && state != -1 )
		{
			switch ( state )
			{
				case 0:	// reading text
					if ( chunkData[pos] == '\\' )
						state = 1;
					else if ( chunkData[pos] == ']' )
						state = -1;
					else
						sb.append( chunkData[pos] );
					break;
				case 1:	// reading backslash
					if ( chunkData[pos] == '\\' )
						sb.append( '\\' );
					else if ( chunkData[pos] == ']' )
						sb.append( ']' );
					state = 0;
					break;					
			}
			pos++;
		}
        realData = new char[sb.length()];
		sb.getChars(0,realData.length,realData,0);
		escapedData = escapeData( realData );
		return pos - start;
	}