aboutsummaryrefslogtreecommitdiff
path: root/java/com
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2012-10-24 15:48:04 +0000
committerMike Buland <eichlan@xagasoft.com>2012-10-24 15:48:04 +0000
commitd9b407475ae3ebe434b29d9eabdd7d4416e17881 (patch)
treea534a268f9e131e64958ca746d912398efbae3db /java/com
parent04f48e8e0560f7c9d4ea883268a3abdbf3bf7d9c (diff)
downloadlibgats-d9b407475ae3ebe434b29d9eabdd7d4416e17881.tar.gz
libgats-d9b407475ae3ebe434b29d9eabdd7d4416e17881.tar.bz2
libgats-d9b407475ae3ebe434b29d9eabdd7d4416e17881.tar.xz
libgats-d9b407475ae3ebe434b29d9eabdd7d4416e17881.zip
More comment/spelling fixes. Added a helper to GatsInputStream so
you can find out how many bytes the previously read object was.
Diffstat (limited to 'java/com')
-rw-r--r--java/com/xagasoft/gats/GatsDictionary.java2
-rw-r--r--java/com/xagasoft/gats/GatsInputStream.java14
-rw-r--r--java/com/xagasoft/gats/KeyNotFoundException.java3
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 */
11public class KeyNotFoundException extends Exception 11public 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