/// <exception cref="System.IO.IOException"/> public static string ReadString(java.io.DataInputStream datainputstream, int i) { short word0 = datainputstream.ReadShort(); if (word0 > i) { throw new System.IO.IOException((new java.lang.StringBuilder()).Append("Received string length longer than maximum allowed (" ).Append(word0).Append(" > ").Append(i).Append(")").ToString()); } if (word0 < 0) { throw new System.IO.IOException("Received string length is less than zero! Weird string!" ); } java.lang.StringBuilder stringbuilder = new java.lang.StringBuilder(); for (int j = 0; j < word0; j++) { stringbuilder.Append(datainputstream.ReadChar()); } return(stringbuilder.ToString()); }