/** * Read the class from the stream * @param inputStream is the stream to read from. * @return is the class read */ static Class<?> readClass(final InputStream inputStream) throws IOException, ClassNotFoundException { boolean standard = readBoolean(inputStream); if (standard) { int index = inputStream.read(); return StandardObjects.codeRegsitry.get(index); } else { String className = readString(inputStream); return Class.forName(className); } }