aboutsummaryrefslogtreecommitdiff
path: root/java/com/xagasoft/gats/GatsString.java
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2012-03-01 04:24:35 +0000
committerMike Buland <eichlan@xagasoft.com>2012-03-01 04:24:35 +0000
commit7dd5c386611e31930e7ccfb83cb585df27696881 (patch)
tree3e88dea538b32b8c6fbc21036a4f4998bf57ba97 /java/com/xagasoft/gats/GatsString.java
parent93831404b4d4ba4e964ebe542c52bc196585d4ab (diff)
downloadlibgats-7dd5c386611e31930e7ccfb83cb585df27696881.tar.gz
libgats-7dd5c386611e31930e7ccfb83cb585df27696881.tar.bz2
libgats-7dd5c386611e31930e7ccfb83cb585df27696881.tar.xz
libgats-7dd5c386611e31930e7ccfb83cb585df27696881.zip
Fixed a bug in java gats reading large strings over the network.
Diffstat (limited to 'java/com/xagasoft/gats/GatsString.java')
-rw-r--r--java/com/xagasoft/gats/GatsString.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/java/com/xagasoft/gats/GatsString.java b/java/com/xagasoft/gats/GatsString.java
index e119aec..8e5c5c0 100644
--- a/java/com/xagasoft/gats/GatsString.java
+++ b/java/com/xagasoft/gats/GatsString.java
@@ -59,9 +59,13 @@ public class GatsString extends GatsObject
59 59
60 void read( InputStream is, char cType ) throws java.io.IOException 60 void read( InputStream is, char cType ) throws java.io.IOException
61 { 61 {
62 long lSize = GatsInteger.readPackedInt( is ); 62 int lSize = (int)GatsInteger.readPackedInt( is );
63 aValue = new byte[(int)lSize]; 63 aValue = new byte[lSize];
64 is.read( aValue ); 64 int lRead = 0;
65 do
66 {
67 lRead += is.read( aValue, lRead, lSize-lRead );
68 } while( lRead < lSize );
65 } 69 }
66 70
67 void write( OutputStream os ) throws java.io.IOException 71 void write( OutputStream os ) throws java.io.IOException