 	 * This class provides two-way communication between Flash applications in the form of an IAsyncService.
 	 */	
 	public class LocalAsyncService implements IAsyncService, IDisposableObject
-	{
+	{
 		/**
 		 * @param receivingObject The object to receive remote commands from.
 		 * @param receivingObjectIsServer If true, receivingObject acts as the server and listens for the remote object acts as a client.

		 * @param chunkData Part of a serialized list of parameters for the receiveCommand() function.
		 * @param moreChunksFollow If this is true, it means more chunks appear after this chunkID.  If false, this is the last chunkID.
		 */
		public function receiveChunkedData(commandID:String, chunkID:uint, chunkData:String, moreChunksFollow:Boolean):void
		{
			// convert String to ByteArray
			var bytes:ByteArray = new ByteArray();
			for (var i:int = 0; i < chunkData.length; i++)
				bytes.writeByte(chunkData.charCodeAt(i));
			bytes.position = 0;
			_receiveChunkedData.apply(null, [commandID, chunkID, bytes, moreChunksFollow]);
		}
		private function _receiveChunkedData(commandID:String, chunkID:uint, chunkData:ByteArray, moreChunksFollow:Boolean):void
		{

				var chunkData:ByteArray = new ByteArray();
				var chunkSize:uint = Math.min(tempByteArray.bytesAvailable, 39900); // size limit for send data is 40k
				tempByteArray.readBytes(chunkData, 0, chunkSize);
				moreChunksFollow = (tempByteArray.bytesAvailable > 0);

				// chunkData was chunkData.toString() before because byteArray is sometimes encoded as a generic object
				// but I can't reproduce it and this fixes a bug with a unicode character (such as the greek lowercase mu, char code 181).
				// the unicode char bug occurs during the toString() call which results in a string with a smaller size than the bytearray.
				conn.send(remoteName, "receiveChunkedData", commandID, chunkID++, chunkData, moreChunksFollow);
			}
		}

