]> granicus.if.org Git - icu/commitdiff
ICU-8854 method ignores result of InputStream.read.
authorAbhinav Gupta <mail@abhinavg.net>
Fri, 4 Nov 2011 15:19:19 +0000 (15:19 +0000)
committerAbhinav Gupta <mail@abhinavg.net>
Fri, 4 Nov 2011 15:19:19 +0000 (15:19 +0000)
X-SVN-Rev: 30927

icu4j/main/classes/core/src/com/ibm/icu/impl/Trie2.java

index 858553335e7ac0fb0cb8cd64d1079f7eda7d02e4..48bb9cc49a31ba1ef09c702533651e348377825d 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *******************************************************************************
- * Copyright (C) 2009-2010, International Business Machines Corporation and
+ * Copyright (C) 2009-2011, International Business Machines Corporation and
  * others. All Rights Reserved.
  *******************************************************************************
  */
@@ -219,9 +219,13 @@ public abstract class Trie2 implements Iterable<Trie2.Range> {
             }
         is.mark(4);
         byte sig[] = new byte[4];
-        is.read(sig);
+        int read = is.read(sig);
         is.reset();
         
+        if (read != sig.length) {
+            return 0;
+        }
+        
         if (sig[0]=='T' && sig[1]=='r' && sig[2]=='i' && sig[3]=='e') {
             return 1;
         }