Hi Gerd

thanks, I think that this improves the code. Small problem:
I think you forgot to remove / adapt some comments in BufferedImgFileWriter,
e.g. for put1 and put2.

Thanks for reminding me.  Attached patch for the messages.  Are there
any more?

Steve
# HG changeset patch
# Parent  aa70a324bc002f47dc6e1e46c95d7e6c605596c6

diff -r aa70a324bc00 -r d7edc89b62d9 src/uk/me/parabola/imgfmt/app/FileBackedImgFileWriter.java
--- a/src/uk/me/parabola/imgfmt/app/FileBackedImgFileWriter.java	Mon Feb 19 21:31:24 2018 +0000
+++ b/src/uk/me/parabola/imgfmt/app/FileBackedImgFileWriter.java	Tue Feb 20 21:23:53 2018 +0000
@@ -49,7 +49,7 @@
 			tmpChannel = out.getChannel();
 			file = new BufferedOutputStream(out, 16*1024);
 		} catch (IOException e) {
-			throw new MapFailedException("Could not create mdr temporary file");
+			throw new MapFailedException("Could not create temporary file");
 		}
 
 		if (chan instanceof FileLink) {
@@ -70,7 +70,7 @@
 			channel.transferTo(0, channel.size(), outputChan);
 		} finally {
 			if (!tmpFile.delete())
-				System.err.println("Could not delete mdr img temporary file");
+				System.err.println("could not delete temporary file " + tmpFile.getPath());
 		}
 	}
 
@@ -99,7 +99,7 @@
 			file.flush();
 			tmpChannel.position(pos);
 		} catch (IOException e) {
-			throw new MapFailedException("Could not set position in mdr tmp file");
+			throw new MapFailedException("could not set position in temporary file " + tmpFile.getPath());
 		}
 	}
 
@@ -112,7 +112,7 @@
  		try {
 			file.write(val);
 		} catch (IOException e) {
-			throw new MapFailedException("could not write byte to mdr tmp file");
+			throw new MapFailedException("could not write to temporary file " + tmpFile.getPath());
 		}
 	}
 
@@ -126,7 +126,7 @@
 			file.write(val);
 			file.write(val >> 8);
 		} catch (IOException e) {
-			throw new MapFailedException("could not write 2 bytes to mdr tmp file");
+			throw new MapFailedException("could not write to temporary file " + tmpFile.getPath());
 		}
 
 	}
@@ -142,7 +142,7 @@
 			file.write(val >> 8);
 			file.write(val >> 16);
 		} catch (IOException e) {
-			throw new MapFailedException("could not write3 to mdr tmp file");
+			throw new MapFailedException("could not write to temporary file " + tmpFile.getPath());
 		}
 	}
 
@@ -165,7 +165,7 @@
 				return;
 			file.write(val >> 24);
 		} catch (IOException e) {
-			throw new MapFailedException("could not write put3 to mdr tmp file");
+			throw new MapFailedException("could not write to temporary file " + tmpFile.getPath());
 		}
 	}
 
@@ -181,7 +181,7 @@
 			file.write(val >> 16);
 			file.write(val >> 24);
 		} catch (IOException e) {
-			throw new MapFailedException("could not write int to mdr tmp file");
+			throw new MapFailedException("could not write to temporary file " + tmpFile.getPath());
 		}
 	}
 
@@ -194,7 +194,7 @@
 		try {
 			file.write(val);
 		} catch (IOException e) {
-			throw new MapFailedException("could not write bytes to mdr tmp file");
+			throw new MapFailedException("could not write to temporary file " + tmpFile.getPath());
 		}
 	}
 
@@ -209,7 +209,7 @@
 		try {
 			file.write(src, start, length);
 		} catch (IOException e) {
-			throw new MapFailedException("could not write bytes to mdr tmp file");
+			throw new MapFailedException("could not write to temporary file " + tmpFile.getPath());
 		}
 	}
 
@@ -223,7 +223,7 @@
 			file.flush();
 			tmpChannel.write(src);
 		} catch (IOException e) {
-			throw new MapFailedException("could not write buffer to mdr tmp file");
+			throw new MapFailedException("could not write to temporary file " + tmpFile.getPath());
 		}
 	}
 
@@ -240,13 +240,13 @@
 			file.flush();
 			return tmpChannel.size();
 		} catch (IOException e) {
-			throw new MapFailedException("could not get size of mdr tmp file");
+			throw new MapFailedException("could not write to temporary file " + tmpFile.getPath());
 		}
 	}
 
 	/**
-	 * Closes this stream and releases any system resources associated with it. If the stream is already closed then
-	 * invoking this method has no effect.
+	 * Closes this stream with the result that the contents of the temporary file are written to the
+	 * real output.
 	 *
 	 * @throws IOException if an I/O error occurs
 	 */
_______________________________________________
mkgmap-dev mailing list
[email protected]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Reply via email to