use tmp buffer to avoid copying one byte at a time.

This commit is contained in:
ehouse 2006-09-10 18:53:03 +00:00
parent c068126c56
commit 10d6394641

View file

@ -285,9 +285,15 @@ static void
mem_stream_copyFromStream( XWStreamCtxt* p_sctx, XWStreamCtxt* src,
XP_U16 nBytes )
{
while ( nBytes-- ) {
XP_U8 byt = stream_getU8( src );
stream_putU8( p_sctx, byt );
while ( nBytes > 0 ) {
XP_U8 buf[256];
XP_U16 len = sizeof(buf);
if ( nBytes < len ) {
len = nBytes;
}
stream_getBytes( src, buf, len );
stream_putBytes( p_sctx, buf, len );
nBytes -= len;
}
} /* mem_stream_copyFromStream */