OSDN Git Service

Let InputStream subclasses report available bytes.
authorJustin Shapcott <support@mobidevelop.com>
Wed, 22 May 2013 07:14:29 +0000 (00:14 -0700)
committerJustin Shapcott <support@mobidevelop.com>
Wed, 22 May 2013 07:14:29 +0000 (00:14 -0700)
backends/gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/java/io/DataInputStream.java
backends/gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/preloader/Blob.java

index 6ad6d0b..9574559 100644 (file)
@@ -146,4 +146,9 @@ public class DataInputStream extends InputStream implements DataInput {
                return 0;
        }
 
+       @Override
+       public int available () {
+               return is.available();
+       }
+       
 }
index 1ec2764..852b8fd 100644 (file)
@@ -43,6 +43,11 @@ public final class Blob {
                                if (pos == length()) return -1;
                                return get(pos++) & 0xff;
                        }
+                       
+                       @Override
+                       public int available () {
+                               return length() - pos;
+                       }
 
                        int pos;
                };