Write fileinput stream directly to zliboutput stream in Plot3DModel

This commit is contained in:
Marek Roszko
2025-05-11 14:11:13 -04:00
parent 7e7b3762bb
commit e30fdcb500
+1 -8
View File
@@ -1956,7 +1956,6 @@ void PDF_PLOTTER::Plot3DModel( const wxString& aSourcePath,
{
wxFFileOutputStream ffos( outputFFile );
wxZlibOutputStream zos( ffos, wxZ_BEST_COMPRESSION, wxZLIB_ZLIB );
wxDataOutputStream dos( zos );
wxFFileInputStream fileStream( aSourcePath );
if( !fileStream.IsOk() )
@@ -1964,13 +1963,7 @@ void PDF_PLOTTER::Plot3DModel( const wxString& aSourcePath,
wxLogError( _( "Failed to open 3D model file: %s" ), aSourcePath );
}
const size_t bufferSize = 4096;
char buffer[bufferSize];
while( !fileStream.Eof() )
{
fileStream.Read( buffer, bufferSize );
zos.Write( buffer, fileStream.LastRead() );
}
zos.Write( fileStream );
}
fflush( m_outputFile );
model_stored_size = ftell( m_outputFile );