@@ -103,19 +103,30 @@ public final String readShortstr()
103103 return readShortstr (this .in );
104104 }
105105
106- /** Public API - convenience method - reads a long string argument from a DataInputStream. */
107- public static final LongString readLongstr (final DataInputStream in )
106+ /** Public API - convenience method - reads a 32-bit-length-prefix
107+ * byte vector from a DataInputStream.
108+ */
109+ public static final byte [] readBytes (final DataInputStream in )
108110 throws IOException
109111 {
110112 final long contentLength = unsignedExtend (in .readInt ());
111113 if (contentLength < Integer .MAX_VALUE ) {
112114 final byte [] buffer = new byte [(int )contentLength ];
113115 in .readFully (buffer );
114-
115- return LongStringHelper .asLongString (buffer );
116- }
116+ return buffer ;
117+ } else {
117118 throw new UnsupportedOperationException
118- ("Very long strings not currently supported" );
119+ ("Very long byte vectors and strings not currently supported" );
120+ }
121+ }
122+
123+ /** Public API - convenience method - reads a long string argument
124+ * from a DataInputStream.
125+ */
126+ public static final LongString readLongstr (final DataInputStream in )
127+ throws IOException
128+ {
129+ return LongStringHelper .asLongString (readBytes (in ));
119130 }
120131
121132 /** Public API - reads a long string argument. */
@@ -206,6 +217,30 @@ public static final Map<String, Object> readTable(DataInputStream in)
206217 case 'F' :
207218 value = readTable (tableIn );
208219 break ;
220+ case 'b' :
221+ value = tableIn .readByte ();
222+ break ;
223+ case 'd' :
224+ value = tableIn .readDouble ();
225+ break ;
226+ case 'f' :
227+ value = tableIn .readFloat ();
228+ break ;
229+ case 'l' :
230+ value = tableIn .readLong ();
231+ break ;
232+ case 's' :
233+ value = tableIn .readShort ();
234+ break ;
235+ case 't' :
236+ value = tableIn .readBoolean ();
237+ break ;
238+ case 'x' :
239+ value = readBytes (tableIn );
240+ break ;
241+ case 'V' :
242+ value = null ;
243+ break ;
209244 default :
210245 throw new MalformedFrameException
211246 ("Unrecognised type in table" );
0 commit comments