diff options
Diffstat (limited to 'java/com/xagasoft/gats/GatsInputStream.java')
-rw-r--r-- | java/com/xagasoft/gats/GatsInputStream.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/java/com/xagasoft/gats/GatsInputStream.java b/java/com/xagasoft/gats/GatsInputStream.java index 84fe40b..7d598b4 100644 --- a/java/com/xagasoft/gats/GatsInputStream.java +++ b/java/com/xagasoft/gats/GatsInputStream.java | |||
@@ -28,7 +28,7 @@ public class GatsInputStream | |||
28 | { | 28 | { |
29 | private InputStream is; | 29 | private InputStream is; |
30 | private int iVer = 0; | 30 | private int iVer = 0; |
31 | private int iSize; | 31 | private int iLastSize = 0; |
32 | 32 | ||
33 | public GatsInputStream( InputStream is ) | 33 | public GatsInputStream( InputStream is ) |
34 | { | 34 | { |
@@ -49,11 +49,21 @@ public class GatsInputStream | |||
49 | { | 49 | { |
50 | case 1: | 50 | case 1: |
51 | DataInputStream dis = new DataInputStream( is ); | 51 | DataInputStream dis = new DataInputStream( is ); |
52 | iSize = dis.readInt(); | 52 | iLastSize = dis.readInt(); |
53 | return GatsObject.read( is ); | 53 | return GatsObject.read( is ); |
54 | } | 54 | } |
55 | 55 | ||
56 | return null; | 56 | return null; |
57 | } | 57 | } |
58 | |||
59 | /** | ||
60 | * Set after each call to readObject, this will tell you how many bytes | ||
61 | * were actually read in to build the object that was returned. | ||
62 | * @return Size in bytes of the most recently read packet. | ||
63 | */ | ||
64 | public int getLastReadPacketSize() | ||
65 | { | ||
66 | return iLastSize; | ||
67 | } | ||
58 | }; | 68 | }; |
59 | 69 | ||