From e12467f252eee4c57bb93b8b8ac1b906b56514af Mon Sep 17 00:00:00 2001 From: Fredrik Roubert Date: Tue, 15 Jul 2014 20:03:25 +0000 Subject: [PATCH] ICU-10944 Delete unused class ICUBinaryStream. R=markus.icu@gmail.com Review URL: https://codereview.appspot.com/111150043 X-SVN-Rev: 36031 --- .../src/com/ibm/icu/impl/ICUBinaryStream.java | 61 ------------------- 1 file changed, 61 deletions(-) delete mode 100644 icu4j/main/classes/core/src/com/ibm/icu/impl/ICUBinaryStream.java diff --git a/icu4j/main/classes/core/src/com/ibm/icu/impl/ICUBinaryStream.java b/icu4j/main/classes/core/src/com/ibm/icu/impl/ICUBinaryStream.java deleted file mode 100644 index f19da11900a..00000000000 --- a/icu4j/main/classes/core/src/com/ibm/icu/impl/ICUBinaryStream.java +++ /dev/null @@ -1,61 +0,0 @@ -/* -********************************************************************** -* Copyright (c) 2002-2010, International Business Machines -* Corporation and others. All Rights Reserved. -********************************************************************** -* Author: Alan Liu -* Created: November 5 2002 -* Since: ICU 2.4 -********************************************************************** -*/ -package com.ibm.icu.impl; - -import java.io.ByteArrayInputStream; -import java.io.DataInputStream; -import java.io.IOException; -import java.io.InputStream; - -/** - * A DataInputStream that implements random-access seeking. For this - * to work, the size of the data stream must be known in advance, or - * the data must be supplied as a raw byte[] array. - * - * Seeking doesn't work directly on all streams. If a given stream - * doesn't support seeking, extract the bytes into a byte[] array and - * use the byte[] constructor. - */ -class ICUBinaryStream extends DataInputStream { - - /** - * Construct a stream from the given stream and size. - * @param stream the stream of data - * @param size the number of bytes that should be made available - * for seeking. Bytes beyond this may be read, but seeking will - * not work for offset >= size. - */ - public ICUBinaryStream(InputStream stream, int size) { - super(stream); - mark(size); - } - - /** - * Construct a stream from the given raw bytes. - */ - public ICUBinaryStream(byte[] raw) { - this(new ByteArrayInputStream(raw), raw.length); - } - - /** - * Seek to the given offset. Offset is from the position of the - * stream passed to the constructor, or from the start of the - * byte[] array. - */ - public void seek(int offset) throws IOException { - reset(); - int actual = skipBytes(offset); - if (actual != offset) { - throw new IllegalStateException("Skip(" + offset + ") only skipped " + - actual + " bytes"); - } - } -} -- 2.40.0