Index: src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundaryUtil.java
===================================================================
--- src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundaryUtil.java	(revision 2248)
+++ src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundaryUtil.java	(working copy)
@@ -225,6 +225,52 @@
 	}
 	
 	/**
+	 * code to read the area info from a stream in legacy format 
+	 * @param inpStream the already opened DataInputStream
+	 * @param id  the boundary Id (used for meaningful messages)
+	 * @return the Area (can be empty)
+	 * @throws IOException
+	 */
+	public static Area readArea(DataInputStream inpStream, String id) throws IOException{
+		int noBElems = inpStream.readInt();
+	
+		// the first area is always an outer area and will be assigned to the variable
+		Area area = null;
+	
+		for (int i = 0; i < noBElems; i++) {
+			boolean outer = inpStream.readBoolean();
+			int noCoords = inpStream.readInt();
+			log.debug("No of coords",noCoords);
+			List<Coord> points = new ArrayList<Coord>(noCoords);
+			for (int c = 0; c < noCoords; c++) {
+				int lat = inpStream.readInt();
+				int lon = inpStream.readInt();
+				points.add(new Coord(lat, lon));
+			}
+	
+			Area elemArea = Java2DConverter.createArea(points);
+			if (outer) {
+				if (area == null) {
+					area = elemArea;
+				} else {
+					area.add(elemArea);
+				}
+			} else {
+				if (area == null) {
+					log.warn("Boundary: " + id);
+					log.warn("Outer way is tagged incosistently as inner way. Ignoring it.");
+					log.warn("Points: "+points);
+				} else {
+					area.subtract(elemArea);
+				}
+			}
+		}
+		if (area == null)
+			area = new Area();
+		return area;
+	}
+
+	/**
 	 * Read boundary info saved in RAW_DATA_FORMAT. 
 	 * @param inpStream the already opened DataInputStream
 	 * @param fname the related file name of the *.bnd file
@@ -234,19 +280,10 @@
 	 */
 	private static List<Boundary> readStreamRawFormat(
 			DataInputStream inpStream, String fname,
-			uk.me.parabola.imgfmt.app.Area bbox) throws IOException			{
+			uk.me.parabola.imgfmt.app.Area bbox, String rel) throws IOException			{
 		List<Boundary> boundaryList = new ArrayList<Boundary>();
 
-
 		try {
-			// 1st read the mkgmap release the boundary file is created by
-			String mkgmapRel = inpStream.readUTF();
-			long createTime = inpStream.readLong();
-			
-			if (log.isDebugEnabled()) {
-				log.debug("File created by mkgmap release",mkgmapRel,"at",new Date(createTime));
-			}
-			
 			while (true) {
 				int minLat = inpStream.readInt();
 				int minLong = inpStream.readInt();
@@ -258,58 +295,27 @@
 				int bSize = inpStream.readInt();
 				log.debug("Size:",bSize);
 
-				if (bbox == null || bbox.intersects(rBbox)) {
+				if ( bbox == null || bbox.intersects(rBbox)) {
 					log.debug("Bbox intersects. Load the boundary");
 					Tags tags = new Tags();
 					int noOfTags = inpStream.readInt();
-					String id = "?"; 
+					String id = "?";
 					for (int i = 0; i < noOfTags; i++) {
 						String name = inpStream.readUTF();
 						String value = inpStream.readUTF();
 						// boundary.id was always saved together with the other tags
 						if (name.equals("mkgmap:boundaryid")){  
-						    id = value;								
-						    continue; 
+							id = value;								
+							continue;
 						}
 						if (name.equals("mkgmap:lies_in") == false) // ignore info from older preparer version 
 							tags.put(name, value.intern()); 					
 					}
-
-					int noBElems = inpStream.readInt();
-					assert noBElems > 0;
-					
-					// the first area is always an outer area and will be assigned to the variable
 					Area area = null;
-					
-					for (int i = 0; i < noBElems; i++) {
-						boolean outer = inpStream.readBoolean();
-						int noCoords = inpStream.readInt();
-						log.debug("No of coords",noCoords);
-						List<Coord> points = new ArrayList<Coord>(noCoords);
-						for (int c = 0; c < noCoords; c++) {
-							int lat = inpStream.readInt();
-							int lon = inpStream.readInt();
-							points.add(new Coord(lat, lon));
-						}
-
-						Area elemArea = Java2DConverter.createArea(points);
-						if (outer) {
-							if (area == null) {
-								area = elemArea;
-							} else {
-								area.add(elemArea);
-							}
-						} else {
-							if (area == null) {
-								log.warn("Boundary: "+tags);
-								log.warn("Outer way is tagged incosistently as inner way. Ignoring it.");
-								log.warn("Points: "+points);
-							} else {
-								area.subtract(elemArea);
-							}
-						}
-					}
-
+					if (rel.endsWith(BoundarySaver.RAW_DATA_FORMAT))
+						area = readArea(inpStream);
+					else // area info was saved in legacy format 
+						area = readArea(inpStream, id);
 					if (area != null) {
 						Boundary boundary = new Boundary(area, tags,id);
 						boundaryList.add(boundary);
@@ -462,7 +468,7 @@
 					
 				}
 				else{
-					List<Boundary> boundaryList = readStreamRawFormat(inpStream, fname, searchBbox);
+					List<Boundary> boundaryList = readStreamRawFormat(inpStream, fname,searchBbox, mkgmapRel);
 					if (boundaryList == null || boundaryList.isEmpty())
 						return null;
 					bqt = new BoundaryQuadTree(qtBbox, boundaryList, props);
