diff options
Diffstat (limited to 'java')
-rw-r--r-- | java/com/xagasoft/gats/GatsDictionary.java | 2 | ||||
-rw-r--r-- | java/com/xagasoft/gats/GatsInputStream.java | 14 | ||||
-rw-r--r-- | java/com/xagasoft/gats/KeyNotFoundException.java | 3 |
3 files changed, 15 insertions, 4 deletions
diff --git a/java/com/xagasoft/gats/GatsDictionary.java b/java/com/xagasoft/gats/GatsDictionary.java index 96a07a7..e359dfa 100644 --- a/java/com/xagasoft/gats/GatsDictionary.java +++ b/java/com/xagasoft/gats/GatsDictionary.java | |||
@@ -9,7 +9,7 @@ import java.util.Hashtable; | |||
9 | 9 | ||
10 | /** | 10 | /** |
11 | * Gats dictionary, or hash table. This stores any number of items, keyed with | 11 | * Gats dictionary, or hash table. This stores any number of items, keyed with |
12 | * strings. The values can be any valid com.xagasoft.gats.GatsObject decendant | 12 | * strings. The values can be any valid com.xagasoft.gats.GatsObject descendant |
13 | * object. This class is often used as the root of complex Gats structures. | 13 | * object. This class is often used as the root of complex Gats structures. |
14 | * <p> | 14 | * <p> |
15 | * This class implements all standard java Map interface features but contains | 15 | * This class implements all standard java Map interface features but contains |
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 | ||
diff --git a/java/com/xagasoft/gats/KeyNotFoundException.java b/java/com/xagasoft/gats/KeyNotFoundException.java index 4b75847..49d14e1 100644 --- a/java/com/xagasoft/gats/KeyNotFoundException.java +++ b/java/com/xagasoft/gats/KeyNotFoundException.java | |||
@@ -5,11 +5,12 @@ package com.xagasoft.gats; | |||
5 | * casting helper functions is used to extract a value. In those cases, | 5 | * casting helper functions is used to extract a value. In those cases, |
6 | * in java we could still potentially return a null (at least if we were | 6 | * in java we could still potentially return a null (at least if we were |
7 | * using object types). This has a couple of advantages when working with | 7 | * using object types). This has a couple of advantages when working with |
8 | * non-object types, and maintains compatability with other implementations | 8 | * non-object types, and maintains compatibility with other implementations |
9 | * of the Gats library. | 9 | * of the Gats library. |
10 | */ | 10 | */ |
11 | public class KeyNotFoundException extends Exception | 11 | public class KeyNotFoundException extends Exception |
12 | { | 12 | { |
13 | private static final long serialVersionUID = -1919827309987785614L; | ||
13 | private Object oSrc = null; | 14 | private Object oSrc = null; |
14 | private String sKey = null; | 15 | private String sKey = null; |
15 | 16 | ||