Fix Asterix Stream Reader

The reset method in the asterix stream reader wasn't working.
Calling clear() on a byte buffer only reset the position but
not the limit. hence, the reader still thinks that there are
some leftover data. This has been fixed to set the limit to 0

Change-Id: I41a84baacdd233120ca08eeebbd2d757b4e5c154
Reviewed-on: https://asterix-gerrit.ics.uci.edu/761
Reviewed-by: Yingyi Bu <buyingyi@gmail.com>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
diff --git a/.gitignore b/.gitignore
index 8d0e894..926dcfe 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,6 +14,7 @@
 asterix-app/mdtest/
 asterix-app/opttest/
 asterix-app/parserts/
+asterix-app/library/
 asterix-app/opt_parserts/
 asterix-app/runtime_parserts/
 asterix-app/data/csv/beer.csv
diff --git a/asterix-external-data/src/main/java/org/apache/asterix/external/input/stream/AsterixInputStreamReader.java b/asterix-external-data/src/main/java/org/apache/asterix/external/input/stream/AsterixInputStreamReader.java
index b1ef892..7e280a5 100644
--- a/asterix-external-data/src/main/java/org/apache/asterix/external/input/stream/AsterixInputStreamReader.java
+++ b/asterix-external-data/src/main/java/org/apache/asterix/external/input/stream/AsterixInputStreamReader.java
@@ -115,6 +115,6 @@
 
     @Override
     public void reset() throws IOException {
-        byteBuffer.clear();
+        byteBuffer.limit(0);
     }
 }