mirror of
				https://github.com/davidgiven/fluxengine.git
				synced 2025-10-24 11:11:02 -07:00 
			
		
		
		
	Merge pull request #155 from davidgiven/amigawriter
Fix stray bytes at the end of images
This commit is contained in:
		| @@ -258,6 +258,11 @@ void Bytes::writeToFile(const std::string& filename) const | ||||
|     f.close(); | ||||
| } | ||||
|  | ||||
| void Bytes::writeTo(std::ostream& stream) const | ||||
| { | ||||
| 	stream.write((const char*) cbegin(), size()); | ||||
| } | ||||
|  | ||||
| ByteReader Bytes::reader() const | ||||
| { | ||||
|     return ByteReader(*this); | ||||
|   | ||||
| @@ -57,6 +57,7 @@ public: | ||||
|     ByteWriter writer(); | ||||
|  | ||||
|     void writeToFile(const std::string& filename) const; | ||||
| 	void writeTo(std::ostream& stream) const; | ||||
|  | ||||
| private: | ||||
|     std::shared_ptr<std::vector<uint8_t>> _data; | ||||
|   | ||||
| @@ -46,7 +46,7 @@ public: | ||||
| 					if (sector) | ||||
| 					{ | ||||
| 						outputFile.seekp(sector->logicalTrack*trackSize + sector->logicalSide*headSize + sector->logicalSector*numBytes, std::ios::beg); | ||||
| 						outputFile.write((const char*) sector->data.cbegin(), sector->data.size()); | ||||
| 						sector->data.slice(0, numBytes).writeTo(outputFile); | ||||
| 					} | ||||
| 				} | ||||
| 			} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user