From: SourceForge.net <no...@so...> - 2005-05-23 04:47:18
|
Bugs item #1206812, was opened at 2005-05-23 06:47 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=462816&aid=1206812&group_id=51305 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: wxgzipstreams Group: v1.0 (example) Status: Open Resolution: None Priority: 5 Submitted By: Steven Van Ingelgem (g00fy) Assigned to: M.J.Wetherell (chiclero) Summary: wxBzipStream makes file wrong Initial Comment: I'm just playing around a bit with the wxBzipStream, and it seems to be converting 0x0A -> 0x0D 0x0A on windows system... Which is ofcourse unacceptable... What I do is the following: ////////////////////////////////////////////////////////////////////////// // Compress BZ2 { wxFFileOutputStream out(_T("test.bz2")); wxBZipOutputStream zip(out); wxFFile in( wxT("projects.db"), wxT("rb") ); size_t size = in.Length(); BYTE * tmp = new BYTE[size]; in.Read(tmp, size); zip.Write( tmp, size ); out.Close(); } ////////////////////////////////////////////////////////////////////////// // Extract BZ2 { wxFFileInputStream in( wxT("test.bz2") ); wxBZipInputStream zip(in); wxFFile out( wxT("temp"), wxT("w") ); BYTE buf[4096]; do { zip.Read(buf, 4096); out.Write(buf, zip.LastRead()); } while( zip.LastRead() > 0 ); } ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=462816&aid=1206812&group_id=51305 |