harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r986147 - /harmony/enhanced/java/trunk/classlib/modules/imageio/src/main/java/javax/imageio/stream/ImageInputStreamImpl.java
Date Mon, 16 Aug 2010 22:32:50 GMT
Author: hindessm
Date: Mon Aug 16 22:32:49 2010
New Revision: 986147

URL: http://svn.apache.org/viewvc?rev=986147&view=rev
Log:
Applying patch from "[#HARMONY-6610] reset bitOffset in the
ImageInputStreamImpl.reset()".

Modified:
    harmony/enhanced/java/trunk/classlib/modules/imageio/src/main/java/javax/imageio/stream/ImageInputStreamImpl.java

Modified: harmony/enhanced/java/trunk/classlib/modules/imageio/src/main/java/javax/imageio/stream/ImageInputStreamImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/classlib/modules/imageio/src/main/java/javax/imageio/stream/ImageInputStreamImpl.java?rev=986147&r1=986146&r2=986147&view=diff
==============================================================================
--- harmony/enhanced/java/trunk/classlib/modules/imageio/src/main/java/javax/imageio/stream/ImageInputStreamImpl.java
(original)
+++ harmony/enhanced/java/trunk/classlib/modules/imageio/src/main/java/javax/imageio/stream/ImageInputStreamImpl.java
Mon Aug 16 22:32:49 2010
@@ -35,6 +35,7 @@ public abstract class ImageInputStreamIm
 	private boolean closed = false;
 
 	private final PositionStack posStack = new PositionStack();
+	private final PositionStack offsetStack = new PositionStack();
 	private final byte[] buff = new byte[8];
 
 	public ImageInputStreamImpl() {
@@ -360,6 +361,7 @@ public abstract class ImageInputStreamIm
 	public void mark() {
 		try {
 			posStack.push(getStreamPosition());
+			offsetStack.push(getBitOffset());
 		} catch (IOException e) {
 			e.printStackTrace();
 			throw new RuntimeException(Messages.getString("imageio.11"));
@@ -367,14 +369,14 @@ public abstract class ImageInputStreamIm
 	}
 
 	public void reset() throws IOException {
-		// -- TODO bit pos
-		if (!posStack.isEmpty()) {
+		if (!posStack.isEmpty() && !offsetStack.isEmpty()) {
 			long p = posStack.pop();
 			if (p < flushedPos) {
 				throw new IOException(
 						Messages.getString("imageio.12"));
 			}
 			seek(p);
+			setBitOffset((int)offsetStack.pop());
 		}
 	}
 



Mime
View raw message