public String readString(DataInputStream stream, int maxLength) throws Exception {
		short length = stream.readShort();
		if (length > maxLength || length < 0) return null;
		
		StringBuilder builder = new StringBuilder();
		for (int i = 0; i < length; i++) {
			builder.append(stream.readChar());
		}
		return builder.toString();
	}