private static SoapTcpFrameContentDescription readContentDescription(final InputStream inputStream)
throws IOException {
final int response[] = new int[2];
DataCodingUtils.readInts4(inputStream, response, 2); //[0] content-id, [1] number-of-parameters
final SoapTcpFrameContentDescription contentDesc = new SoapTcpFrameContentDescription();
contentDesc.setContentId(response[0]);
final int numOfParams = response[1];
final Map<Integer, String> parameters = new Hashtable<Integer, String>();
for (int i = 0; i < numOfParams; i++) {
DataCodingUtils.readInts4(inputStream, response, 2); //[0] parameter-id, [1] string-length
if (response[1] > 0) {
final byte[] buffer = new byte[response[1]];
if (inputStream.read(buffer) > 0) {
final String value = new String(buffer, "UTF-8");
parameters.put(Integer.valueOf(response[0]), value);
//System.out.println("parameter-id = " + response[0] + " parameter-value = " + value);
}
}
}
contentDesc.setParameters(parameters);
return contentDesc;
}