1 11 package com.ibm.icu.impl; 12 13 import java.io.*; 14 15 24 class ICUBinaryStream extends DataInputStream { 25 26 33 public ICUBinaryStream(InputStream stream, int size) { 34 super(stream); 35 mark(size); 36 } 37 38 41 public ICUBinaryStream(byte[] raw) { 42 this(new ByteArrayInputStream(raw), raw.length); 43 } 44 45 50 public void seek(int offset) throws IOException { 51 reset(); 52 int actual = skipBytes(offset); 53 if (actual != offset) { 54 throw new IllegalStateException ("Skip(" + offset + ") only skipped " + 55 actual + " bytes"); 56 } 57 if (false) System.out.println("(seek " + offset + ")"); 58 } 59 } 60 | Popular Tags |