From a7fd5fd70af74ab668d56750df6c91ae25f56768 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ryszard=20Wi=C5=9Bniewski?= Date: Thu, 3 Jun 2010 12:51:44 +0200 Subject: [PATCH] StringBlock: changed type of m_strings from int[] to byte[]. --- src/brut/androlib/res/decoder/StringBlock.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/brut/androlib/res/decoder/StringBlock.java b/src/brut/androlib/res/decoder/StringBlock.java index 64180964..2480c81b 100644 --- a/src/brut/androlib/res/decoder/StringBlock.java +++ b/src/brut/androlib/res/decoder/StringBlock.java @@ -54,7 +54,8 @@ public class StringBlock { if ((size % 4) != 0) { throw new IOException("String data size is not multiple of 4 (" + size + ")."); } - block.m_strings = reader.readIntArray(size / 4); + block.m_strings = new byte[size]; + reader.readFully(block.m_strings); } if (stylesOffset != 0) { int size = (chunkSize - stylesOffset); @@ -227,6 +228,10 @@ public class StringBlock { return style; } + private static final int getShort(byte[] array, int offset) { + return (array[offset + 1] & 0xff) << 8 | array[offset] & 0xff; + } + private static final int getShort(int[] array, int offset) { int value = array[offset / 4]; if ((offset % 4) / 2 == 0) { @@ -236,7 +241,7 @@ public class StringBlock { } } private int[] m_stringOffsets; - private int[] m_strings; + private byte[] m_strings; private int[] m_styleOffsets; private int[] m_styles; private static final int CHUNK_TYPE = 0x001C0001;