From 4fb4a056c52d3a96b6ef9a4ceb5ce39fc716a9aa Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 21 Apr 2011 17:40:13 +0000 Subject: It...builds? --- java/com/xagasoft/gats/GatsInputStream.java | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'java/com/xagasoft/gats/GatsInputStream.java') diff --git a/java/com/xagasoft/gats/GatsInputStream.java b/java/com/xagasoft/gats/GatsInputStream.java index e787d56..e1c4781 100644 --- a/java/com/xagasoft/gats/GatsInputStream.java +++ b/java/com/xagasoft/gats/GatsInputStream.java @@ -2,6 +2,7 @@ package com.xagasoft.gats; import java.io.InputStream; import java.io.ByteArrayOutputStream; +import java.io.ByteArrayInputStream; import java.io.DataInputStream; public class GatsInputStream @@ -16,7 +17,7 @@ public class GatsInputStream this.is = is; } - public GatsObject readObject() + public GatsObject readObject() throws java.io.IOException { do { @@ -24,7 +25,7 @@ public class GatsInputStream { byte aBuf[] = new byte[5-baos.size()]; int iRead = is.read( aBuf ); - baos.write( ret, iRead ); + baos.write( aBuf, 0, iRead ); if( baos.size() < 5 ) return null; @@ -36,7 +37,7 @@ public class GatsInputStream ByteArrayInputStream bais = new ByteArrayInputStream( baos.toByteArray() ); - DataInputStream dis( bais ); + DataInputStream dis = new DataInputStream( bais ); iVer = dis.readUnsignedByte(); iSize = dis.readInt(); } @@ -49,7 +50,7 @@ public class GatsInputStream iGoal = 1500; int iRead = is.read( aBuf ); - baos.write( abuf, 0, iRead ); + baos.write( aBuf, 0, iRead ); if( iRead < iGoal ) return null; @@ -63,14 +64,13 @@ public class GatsInputStream ); bais.skip( 5 ); - GatsObject goRet = GatsObject::read( bais ); + GatsObject goRet = GatsObject.read( bais ); iVer = 0; return goRet; } - - private bool skipReadNulls() + private boolean skipReadNulls() { if( baos.size() == 0 ) return false; @@ -79,17 +79,17 @@ public class GatsInputStream if( aBuf[0] != 0 ) return true; - for( int j = 1; j < aBuf.size; j++ ) + for( int j = 1; j < aBuf.length; j++ ) { if( aBuf[j] != 0 ) { - baos.clear(); - baos.write( aBuf, j, aBuf.size-j ); + baos.reset(); + baos.write( aBuf, j, aBuf.length-j ); return true; } } - baos.clear(); + baos.reset(); return true; } }; -- cgit v1.2.3