DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Untracked file

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733
DON'T COMPILE ME!!!
RICHIE
RICHIE
RICHIE      OLD FE INTERFACES TO APPLEDOUBLE ENCODE/DECODE
RICHIE
RICHIE
RICHIE

/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 *
 * The contents of this file are subject to the Netscape Public License
 * Version 1.0 (the "NPL"); you may not use this file except in
 * compliance with the NPL.  You may obtain a copy of the NPL at
 * http://www.mozilla.org/NPL/
 *
 * Software distributed under the NPL is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
 * for the specific language governing rights and limitations under the
 * NPL.
 *
 * The Initial Developer of this code under the NPL is Netscape
 * Communications Corporation.  Portions created by Netscape are
 * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
 * Reserved.
 */

/**
*	Apple Double encode/decode stream
*	----------------------------------
*
*		11sep95		mym		created.
*/

#include "nscore.h"
#include "msgCore.h"
#include "prio.h"

#include "nsMsgAppleDouble.h"
#include "nsMsgAppleCodes.h"

#include "nsMsgBinHex.h"
#include "m_cvstrm.h"

extern int MK_MSG_SAVE_ATTACH_AS;

#ifdef RICHIE_XP_MAC
#pragma warn_unusedarg off

extern int MK_UNABLE_TO_OPEN_TMP_FILE;
extern int MK_MIME_ERROR_WRITING_FILE;

/*	---------------------------------------------------------------------------------
**
**		The codes for Apple-double encoding stream. --- it's only useful on Mac OS
**
**	---------------------------------------------------------------------------------
*/

#define WORKING_BUFF_SIZE	8192

typedef struct	_AppledoubleEncodeObject
{
	appledouble_encode_object	ap_encode_obj;
	
	char*	buff;							/*	the working buff.					*/
	PRInt32	s_buff;							/*	the working buff size.				*/

	RICHIE_XP_File	fp;								/*  file to hold the encoding			*/
	char	*fname;							/*	and the file name.					*/
	
} AppleDoubleEncodeObject;

/*
	Let's go "l" characters forward of the encoding for this write.
	Note:	
		"s" is just a dummy paramter. 
 */
PRIVATE int 
net_AppleDouble_Encode_Write (
	void *stream, const char* s, PRInt32 l)
{
	int  status = 0;
	AppleDoubleEncodeObject * obj = (AppleDoubleEncodeObject*)stream;
	PRInt32 count, size;	
			
	while (l > 0)
	{
		size = obj->s_buff * 11 / 16;
		size = PR_MIN(l, size);
		status = ap_encode_next(&(obj->ap_encode_obj), 
							obj->buff, 
							size, 
							&count);
		if (status == noErr || status == errDone)
		{
			/*
			 * we get the encode data, so call the next stream to write it to the disk.
			 */
			if (RICHIE_XP_FileWrite(obj->buff, count, obj->fp) != count)
				return errFileWrite;
		}
		
		if (status != noErr ) 							/* abort when error	/ done?		*/
			break;
			
		l -= size;
	}
	return status;
}

/*
** is the stream ready for writing?
 */
PRIVATE unsigned int net_AppleDouble_Encode_Ready (void *stream)
{	
   return(PR_MAX_WRITE_READY);  						/* always ready for writing 	*/ 
}


PRIVATE void net_AppleDouble_Encode_Complete (void *stream)
{
	AppleDoubleEncodeObject * obj = (AppleDoubleEncodeObject*)stream;	

    ap_encode_end(&(obj->ap_encode_obj), false);	/* this is a normal ending 		*/
 	
 	if (obj->fp)
 	{
    	RICHIE_XP_FileClose(obj->fp);						/* done with the target file	*/

        PR_FREEIF(obj->fname);							/* and the file name too		*/
    }
								
    PR_FREEIF(obj->buff);								/* free the working buff.		*/
    PR_FREEIF(obj);
}

PRIVATE void net_AppleDouble_Encode_Abort (void *stream, int status)
{
	AppleDoubleEncodeObject * obj = (AppleDoubleEncodeObject*)stream;	
	
    ap_encode_end(&(obj->ap_encode_obj), true);		/* it is an aborting exist... 	*/

 	if (obj->fp)
 	{   
 		RICHIE_XP_FileClose(obj->fp);

        RICHIE_XP_FileRemove (obj->fname, xpURL);			/* remove the partial file.		*/
        
        PR_FREEIF(obj->fname);
	}
    PR_FREEIF(obj->buff);								/* free the working buff.		*/
    PR_FREEIF(obj);
}

/*
**	fe_MakeAppleDoubleEncodeStream
**	------------------------------
**
**	Will create a apple double encode stream:
**
**		-> take the filename as the input source (it needs to be a mac file.)
**		-> take a file name for the temp file we are generating.
*/

PUBLIC NET_StreamClass * 
fe_MakeAppleDoubleEncodeStream (int  format_out,
                         void       *data_obj,
                         URL_Struct *URL_s,
                         MWContext  *window_id,
                         char*		src_filename,
                         char* 		dst_filename,
                         char*		separator)
{
    AppleDoubleEncodeObject* obj;
    NET_StreamClass* 	  stream;
    char*				  working_buff = NULL;
	int					  bSize = WORKING_BUFF_SIZE;
    
    TRACEMSG(("Setting up apple encode stream. Have URL: %s\n", URL_s->address));

    stream = new (NET_StreamClass);
    if(stream == NULL) 
        return(NULL);

    obj = new (AppleDoubleEncodeObject);
    if (obj == NULL) 
    {
        PR_FREEIF (stream);
        return(NULL);
    }
   
	while (!working_buff && (bSize >= 512))
	{
   		working_buff = (char *)PR_CALLOC(bSize);
		if (!working_buff)
			bSize /= 2;
	}
   	if (working_buff == NULL)
   	{
   		PR_FREEIF (obj);
   		PR_FREEIF (stream);
		return (NULL);
   	}
  	
    stream->name           = "Apple Double Encode";
    stream->complete       = (MKStreamCompleteFunc) 	net_AppleDouble_Encode_Complete;
    stream->abort          = (MKStreamAbortFunc) 		net_AppleDouble_Encode_Abort;
    stream->put_block      = (MKStreamWriteFunc) 		net_AppleDouble_Encode_Write;
    stream->is_write_ready = (MKStreamWriteReadyFunc) 	net_AppleDouble_Encode_Ready;
    stream->data_object    = obj;
    stream->window_id      = window_id;

	obj->fp  = RICHIE_XP_FileOpen(dst_filename, xpFileToPost, RICHIE_XP_FILE_WRITE_BIN);
	if (obj->fp == NULL)
	{
		PR_FREEIF (working_buff);
   		PR_FREEIF (obj);
   		PR_FREEIF (stream);
		return (NULL);
	}
	
  obj->fname = nsCRT::strdup(dst_filename);
	 
	obj->buff	= working_buff;
	obj->s_buff = bSize;
	
	/*
	** 	setup all the need information on the apple double encoder.
	*/
	ap_encode_init(&(obj->ap_encode_obj), 
					src_filename,					/* pass the file name of the source.	*/
					separator);
					
    TRACEMSG(("Returning stream from NET_AppleDoubleEncoder\n"));

    return stream;
}
#endif

/*
**	---------------------------------------------------------------------------------
**
**		The codes for the Apple sigle/double decoding.
**
**	---------------------------------------------------------------------------------
*/
typedef	struct AppleDoubleDecodeObject
{
	appledouble_decode_object	ap_decode_obj;
	
	char*	in_buff;						/* the temporary buff to accumulate  	*/
											/* the input, make sure the call to  	*/
											/* the dedcoder engine big enough buff 	*/
	PRInt32	bytes_in_buff;					/* the count for the temporary buff.	*/
	
    NET_StreamClass*	binhex_stream;		/* a binhex encode stream to convert 	*/
    										/* the decoded mac file to binhex.		*/
    										
} AppleDoubleDecodeObject;

PRIVATE int
net_AppleDouble_Decode_Write (
	void *stream, const char* s, PRInt32 l)
{
	int 	status = NOERR;
	AppleDoubleDecodeObject * obj = (AppleDoubleDecodeObject*) stream;
	PRInt32	size;	

	/*
	**	To force an effecient decoding, we should	
	**  make sure that the buff pass to the decode next is great than 1024 bytes.
	*/
	if (obj->bytes_in_buff + l > 1024)
	{
		size = 1024 - obj->bytes_in_buff;
		memcpy(obj->in_buff+obj->bytes_in_buff, 
		       s, 
		       size);
		s += size;
		l -= size;
		
		status = ap_decode_next(&(obj->ap_decode_obj), 
					obj->in_buff, 
					1024);
		obj->bytes_in_buff = 0;
	}
	
	if (l > 1024)
	{
		/* we are sure that obj->bytes_in_buff == 0 at this point. */
		status = ap_decode_next(&(obj->ap_decode_obj), 
					(char *)s, 
					l);		
	}
	else
	{
		/* and we are sure we will not get overflow with the buff. */ 
		memcpy(obj->in_buff+obj->bytes_in_buff, 
		       s, 
		       l);
		obj->bytes_in_buff += l;
	}
	return status;
}

PRIVATE unsigned int 
net_AppleDouble_Decode_Ready (NET_StreamClass *stream)
{	
   return(PR_MAX_WRITE_READY); 	 						/* always ready for writing 	*/ 
}


PRIVATE void 
net_AppleDouble_Decode_Complete (void *stream)
{
	AppleDoubleDecodeObject *obj = (AppleDoubleDecodeObject *)stream;	
	
	if (obj->bytes_in_buff)
	{
		
		ap_decode_next(&(obj->ap_decode_obj), 			/* do the last calls.			*/
				(char *)obj->in_buff,
				obj->bytes_in_buff);
		obj->bytes_in_buff = 0;
	}

    ap_decode_end(&(obj->ap_decode_obj), FALSE);		/* it is a normal clean up cases.*/

	if (obj->binhex_stream)
		PR_FREEIF(obj->binhex_stream);
	
	if (obj->in_buff)
		PR_FREEIF(obj->in_buff);
		
	PR_FREEIF(obj);
}

PRIVATE void 
net_AppleDouble_Decode_Abort (
	void *stream, int status)
{
	AppleDoubleDecodeObject *obj = (AppleDoubleDecodeObject *)stream;	

	ap_decode_end(&(obj->ap_decode_obj), TRUE);			/* it is an abort. 				*/
	
	if (obj->binhex_stream)
		PR_FREEIF(obj->binhex_stream);
	
	if (obj->in_buff)
		PR_FREEIF(obj->in_buff);
		
	PR_FREEIF(obj);
}


/*
**	fe_MakeAppleDoubleDecodeStream_1
**	---------------------------------
**	
**		Create the apple double decode stream.
**
**		In the Mac OS, it will create a stream to decode to an apple file;
**
**		In other OS,  the stream will decode apple double object, 
**					  then encode it in binhex format, and save to the file.
*/
#ifndef RICHIE_XP_MAC
static void
simple_copy(MWContext* context, char* saveName, void* closure)
{
	/* just copy the filename to the closure, so the caller can get it.	*/
  PL_strcpy(closure, saveName);
}
#endif

PUBLIC NET_StreamClass * 
fe_MakeAppleDoubleDecodeStream_1 (int  format_out,
                         void       *data_obj,
                         URL_Struct *URL_s,
                         MWContext  *window_id)
{
#ifdef RICHIE_XP_MAC
	return fe_MakeAppleDoubleDecodeStream(format_out, 
						data_obj, 
						URL_s, 
						window_id, 
						false,
						NULL);
#else

#if 0		/* just a test in the mac OS	*/
	NET_StreamClass *p;
	char*	url; 
	StandardFileReply	reply;
		
	StandardPutFile("\pSave binhex encoded file as:", "\pUntitled", &reply);
	if (!reply.sfGood) 
	{
		return NULL;
	}
	url = my_PathnameFromFSSpec(&(reply.sfFile));
	
	p = fe_MakeAppleDoubleDecodeStream(format_out, 
						data_obj, 
						URL_s, 
						window_id, 
						true,
						url+7);
	PR_FREEIF(url);
	return (p);

#else	/* for the none mac-os to get a file name */

	NET_StreamClass *p;
	char* filename;
	
	filename = PR_CALLOC(1024);
	if (filename == NULL)
		return NULL;

/***** RICHIE - CONVERT THIS
	if (FE_PromptForFileName(window_id, 
				RICHIE_XP_GetString(MK_MSG_SAVE_ATTACH_AS),
				0,
				FALSE,
				FALSE,
				simple_copy,
				filename) == -1)
	{
		return	NULL;
	}
***/

	p = fe_MakeAppleDoubleDecodeStream(format_out, 
						data_obj, 
						URL_s, 
						window_id, 
						TRUE,
						filename);
	PR_FREEIF(filename);
	return (p);	

#endif
	
#endif
}

                    
PUBLIC NET_StreamClass * 
fe_MakeAppleDoubleDecodeStream (int  format_out,
                         void       *data_obj,
                         URL_Struct *URL_s,
                         MWContext  *window_id,
                         PRBool	write_as_binhex,
                         char 		*dst_filename)	
{
    AppleDoubleDecodeObject* obj;
    NET_StreamClass* 	  stream;
    
    TRACEMSG(("Setting up apple double decode stream. Have URL: %s\n", URL_s->address));

    stream = new (NET_StreamClass);
    if(stream == NULL) 
        return(NULL);

    obj = new (AppleDoubleDecodeObject);
    if (obj == NULL)
    {
    	PR_FREEIF(stream);
        return(NULL);
    }
    
    stream->name           = "AppleDouble Decode";
    stream->complete       = (MKStreamCompleteFunc) 	net_AppleDouble_Decode_Complete;
    stream->abort          = (MKStreamAbortFunc) 		net_AppleDouble_Decode_Abort;
    stream->put_block      = (MKStreamWriteFunc) 		net_AppleDouble_Decode_Write;
    stream->is_write_ready = (MKStreamWriteReadyFunc) 	net_AppleDouble_Decode_Ready;
    stream->data_object    = obj;
    stream->window_id      = window_id;

	/*
	** setup all the need information on the apple double encoder.
	*/
	obj->in_buff = (char *)PR_CALLOC(1024);
	if (obj->in_buff == NULL)
	{
		PR_FREEIF(obj);
		PR_FREEIF(stream);
		return (NULL);
	}
	
	obj->bytes_in_buff = 0;
	
	if (write_as_binhex)
	{
		obj->binhex_stream = 
			fe_MakeBinHexEncodeStream(format_out,
							data_obj,
							URL_s,
							window_id,
							dst_filename);
		if (obj->binhex_stream == NULL)
		{
			PR_FREEIF(obj);
			PR_FREEIF(stream);
			PR_FREEIF(obj->in_buff);
			return NULL;
		}
		
		ap_decode_init(&(obj->ap_decode_obj), 
							FALSE,
							TRUE, 
							obj->binhex_stream);		
	}
	else
	{
		obj->binhex_stream = NULL;
		ap_decode_init(&(obj->ap_decode_obj), 
							FALSE,
							FALSE, 
							window_id);
		/*
		 * jt 8/8/97 -- I think this should be set to true. But'
		 * let's not touch it for now.
		 *
		 * obj->ap_decode_obj.is_binary = TRUE;
		 */
	}

	if (dst_filename) 
	{
		RICHIE_XP_STRNCPY_SAFE(obj->ap_decode_obj.fname, dst_filename, 
						sizeof(obj->ap_decode_obj.fname));
	}
	#ifdef RICHIE_XP_MAC		
	obj->ap_decode_obj.mSpec = (FSSpec*)( URL_s->fe_data );
	#endif
    TRACEMSG(("Returning stream from NET_AppleDoubleDecode\n"));

    return stream;
}

/*
**	fe_MakeAppleSingleDecodeStream_1
**	--------------------------------
**	
**		Create the apple single decode stream.
**
**		In the Mac OS, it will create a stream to decode object to an apple file;
**
**		In other OS,  the stream will decode apple single object, 
**					  then encode context in binhex format, and save to the file.
*/

PUBLIC NET_StreamClass * 
fe_MakeAppleSingleDecodeStream_1 (int  format_out,
                         void       *data_obj,
                         URL_Struct *URL_s,
                         MWContext  *window_id)
{
#ifdef RICHIE_XP_MAC
	return fe_MakeAppleSingleDecodeStream(format_out, 
						data_obj, 
						URL_s, 
						window_id, 
						FALSE,
						NULL);
#else

#if 0		/* just a test in the mac OS	*/
	NET_StreamClass *p;
	char*	url; 
	StandardFileReply	reply;
		
	StandardPutFile("\pSave binhex encoded file as:", "\pUntitled", &reply);
	if (!reply.sfGood) 
	{
		return NULL;
	}
	url = my_PathnameFromFSSpec(&(reply.sfFile));
	
	p = fe_MakeAppleSingleDecodeStream(format_out, 
						data_obj, 
						URL_s, 
						window_id, 
						true,
						url+7);
	PR_FREEIF(url);
	return (p);

#else	/* for the none mac-os to get a file name */

	NET_StreamClass *p;
	char* filename;
	char* defaultPath = 0;

	defaultPath = URL_s->content_name;

#ifdef RICHIE_XP_WIN16
	if (RICHIE_XP_FileNameContainsBadChars(defaultPath))
		defaultPath = 0;
#endif
	
	filename = PR_CALLOC(1024);
	if (filename == NULL)
		return NULL;

/***** RICHIE - CONVERT THIS
	if (FE_PromptForFileName(window_id, 
				RICHIE_XP_GetString(MK_MSG_SAVE_ATTACH_AS),
				defaultPath,
				FALSE,
				FALSE,
				simple_copy,
				filename) == -1)
	{
		return	NULL;
	}
*********/
  
	p = fe_MakeAppleSingleDecodeStream(format_out, 
						data_obj, 
						URL_s, 
						window_id, 
						FALSE,
						filename);
	PR_FREEIF(filename);
	return (p);	

#endif

#endif
}

/*
**	Create the Apple Doube Decode stream.
**
*/
PUBLIC NET_StreamClass * 
fe_MakeAppleSingleDecodeStream (int  format_out,
                         void       *data_obj,
                         URL_Struct *URL_s,
                         MWContext  *window_id,
                         PRBool	write_as_binhex,
                         char 		*dst_filename)	
{
    AppleDoubleDecodeObject* obj;
    NET_StreamClass* 	  stream;
    int encoding = kEncodeNone; /* default is that we don't know the encoding */
    
    TRACEMSG(("Setting up apple single decode stream. Have URL: %s\n", URL_s->address));

    stream = RICHIE_XP_NEW(NET_StreamClass);
    if(stream == NULL) 
        return(NULL);

    obj = RICHIE_XP_NEW(AppleDoubleDecodeObject);
    if (obj == NULL)
    {
    	PR_FREEIF(stream);
        return(NULL);
    }
    
    stream->name           = "AppleSingle Decode";
    stream->complete       = (MKStreamCompleteFunc) 	net_AppleDouble_Decode_Complete;
    stream->abort          = (MKStreamAbortFunc) 		net_AppleDouble_Decode_Abort;
    stream->put_block      = (MKStreamWriteFunc) 		net_AppleDouble_Decode_Write;
    stream->is_write_ready = (MKStreamWriteReadyFunc) 	net_AppleDouble_Decode_Ready;
    stream->data_object    = obj;
    stream->window_id      = window_id;

	/*
	** setup all the need information on the apple double encoder.
	*/
	obj->in_buff = (char *)PR_CALLOC(1024);
	if (obj->in_buff == NULL)
	{
		PR_FREEIF(obj);
		PR_FREEIF(stream);
		return (NULL);
	}
	
	obj->bytes_in_buff = 0;
	
	if (write_as_binhex)
	{
		obj->binhex_stream = 
			fe_MakeBinHexEncodeStream(format_out,
							data_obj,
							URL_s,
							window_id,
							dst_filename);
		if (obj->binhex_stream == NULL)
		{
			PR_FREEIF(obj);
			PR_FREEIF(stream);
			PR_FREEIF(obj->in_buff);
			return NULL;
		}
		
		ap_decode_init(&(obj->ap_decode_obj), 
							TRUE,
							TRUE, 
							obj->binhex_stream);		
	}
	else
	{
		obj->binhex_stream = NULL;
		ap_decode_init(&(obj->ap_decode_obj), 
							TRUE,
							FALSE, 
							window_id);
#ifndef RICHIE_XP_MAC
		obj->ap_decode_obj.is_binary = TRUE;
#endif
	}

	if (dst_filename) 
	{
		RICHIE_XP_STRNCPY_SAFE(obj->ap_decode_obj.fname, dst_filename, 
						sizeof(obj->ap_decode_obj.fname));
	}
	/* If we are of a broken content-type, impose its encoding. */
	if (URL_s->content_type 
		&& !RICHIE_XP_STRNCASECMP(URL_s->content_type, "x-uuencode-apple-single", 23))
		obj->ap_decode_obj.encoding = kEncodeUU;
	else
		obj->ap_decode_obj.encoding = kEncodeNone;

    TRACEMSG(("Returning stream from NET_AppleSingleDecode\n"));

    return stream;
}