From 3c65dcca1b45df48c8e6499c6d3ff137c32b3e08 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sat, 23 May 2015 12:47:37 +0300 Subject: [PATCH] Improve packing bytes into UTF-8 --- .../src/net/osmand/binary/BinaryMapPoiReaderAdapter.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/OsmAnd-java/src/net/osmand/binary/BinaryMapPoiReaderAdapter.java b/OsmAnd-java/src/net/osmand/binary/BinaryMapPoiReaderAdapter.java index fa207898dc..c532693d99 100644 --- a/OsmAnd-java/src/net/osmand/binary/BinaryMapPoiReaderAdapter.java +++ b/OsmAnd-java/src/net/osmand/binary/BinaryMapPoiReaderAdapter.java @@ -710,14 +710,7 @@ public class BinaryMapPoiReaderAdapter { byte[] bytes = new byte[str.length() - ind]; for(int i = ind; i < str.length(); i++ ) { char ch = str.charAt(i) ; - if(ch < 0 || ch >= 256) { - throw new IllegalStateException(); - } - if(ch >= 128) { - bytes[i - ind] = (byte) (ch - 256); - } else if(ch >= 0){ - bytes[i - ind] = (byte) ch; - } + bytes[i - ind] = (byte) ((int)ch - 128 - 32); } GZIPInputStream gzn = new GZIPInputStream(new ByteArrayInputStream(