Code example for BufferedInputStream

Methods: read, reset, skip

0
		} 
 
		private final byte[] buf = new byte[8];
		public final int readIntLE() throws IOException 
		{ 
			reader.read(buf, 0, 4);
			return 
					(buf[3]&0xff) << 24 |
					(buf[2]&0xff) << 16 |
					(buf[1]&0xff) <<  8 |
					(buf[0]&0xff);
		} 
 
		private void seek(int pos) throws IOException {
			reader.reset();
			reader.skip(pos);
		} 
 
		private byte[] getTranslatedStringAt(int idx) throws IOException {
			seek(offsetTranslatedStrings + idx*8);
			int length = readIntLE();
			int offset = readIntLE();
			seek(offset);
			byte[] result = new byte[length];
			reader.read(result, 0, length);
			return result;
		} 
 
		private int compare(byte[] bytes, int idx) throws IOException {
			seek(offsetOriginalStrings + idx*8);