--- ucb/source/ucp/gvfs/stream.cxx	2007-04-10 14:23:52.000000000 +0200
+++ ucb/source/ucp/gvfs/stream.cxx	2007-04-10 14:36:08.000000000 +0200
@@ -128,7 +128,6 @@ sal_Int32 SAL_CALL Stream::readBytes(
 		       RuntimeException )
 {
 	GnomeVFSResult   result;
-	GnomeVFSFileSize nBytesRead = 0;
 
 	if( ! m_handle )
 		throw IOException();
@@ -144,10 +143,15 @@ sal_Int32 SAL_CALL Stream::readBytes(
 		throw BufferSizeExceededException();
 	}
 
+	GnomeVFSFileSize nTotalBytesRead = 0;
 	do {
-		result = gnome_vfs_read( m_handle, aData.getArray(),
-					 nBytesToRead, &nBytesRead );
-	} while( result == GNOME_VFS_ERROR_INTERRUPTED );
+		GnomeVFSFileSize nBytesRead = 0;
+		do {
+			result = gnome_vfs_read( m_handle, aData.getArray() + nTotalBytesRead,
+					nBytesToRead - nTotalBytesRead, &nBytesRead );
+		} while( result == GNOME_VFS_ERROR_INTERRUPTED );
+		nTotalBytesRead += nBytesRead;
+	} while( result == GNOME_VFS_OK && nTotalBytesRead < nBytesToRead );
 
 	if (result != GNOME_VFS_OK &&
 	    result != GNOME_VFS_ERROR_EOF)
@@ -156,9 +160,9 @@ sal_Int32 SAL_CALL Stream::readBytes(
 	if (result == GNOME_VFS_ERROR_EOF)
 		m_eof = sal_True;
 
-	aData.realloc( sal::static_int_cast<sal_uInt32>(nBytesRead) );
+	aData.realloc( sal::static_int_cast<sal_uInt32>(nTotalBytesRead) );
 
-	return sal::static_int_cast<sal_Int32>(nBytesRead);
+	return sal::static_int_cast<sal_Int32>(nTotalBytesRead);
 }
 
 sal_Int32 SAL_CALL Stream::readSomeBytes(
