+
+
+
+
+
+
+
+  |
+
+
+
+ $projectname
+ $projectnumber
+
+
+
+ $projectbrief
+ |
+
+
+
+
+ $projectbrief
+ |
+
+
+
+
+ $searchbox |
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/include/JavaObject/EJavaTypeCode.h b/include/JavaObject/EJavaTypeCode.h
deleted file mode 100644
index af5ec64..0000000
--- a/include/JavaObject/EJavaTypeCode.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/** @file EJavaTypeCode.h
- *
- * @author DexrnZacAttack
- * @date 3/23/26
- *
- * @device zPc-i2
- *
- * @copyright Copyright (c) 2026 Team Lodestone
- * @license This project is licensed under the MIT license, see the LICENSE file for details.
- */
-#ifndef JAVAOBJECTSTREAMS_EJAVATYPECODE_H
-#define JAVAOBJECTSTREAMS_EJAVATYPECODE_H
-
-enum EJavaTypeCode : signed char {
- TC_NULL = 0x70,
- TC_REFERENCE = 0x71,
- TC_CLASSDESC = 0x72,
- TC_OBJECT = 0x73,
- TC_STRING = 0x74,
- TC_ARRAY = 0x75,
- TC_CLASS = 0x76,
- TC_BLOCKDATA = 0x77,
- TC_ENDBLOCKDATA = 0x78,
- TC_RESET = 0x79,
- TC_BLOCKDATALONG = 0x7a,
- TC_EXCEPTION = 0x7B,
- TC_LONGSTRING = 0x7C,
- TC_PROXYCLASSDESC = 0x7D,
- TC_ENUM = 0x7E,
-
- TC_BASE = TC_NULL, // lowest value
- TC_MAX = TC_ENUM // highest value
-};
-
-#endif // JAVAOBJECTSTREAMS_EJAVATYPECODE_H
diff --git a/include/JavaObject/EObjectTypeCode.h b/include/JavaObject/EObjectTypeCode.h
new file mode 100644
index 0000000..a78ab4a
--- /dev/null
+++ b/include/JavaObject/EObjectTypeCode.h
@@ -0,0 +1,35 @@
+/** @file EJavaTypeCode.h
+ *
+ * @author DexrnZacAttack
+ * @date 3/23/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_EJAVATYPECODE_H
+#define JAVAOBJECTSTREAMS_EJAVATYPECODE_H
+
+enum class EObjectTypeCode : signed char {
+ TC_NULL = 0x70,
+ TC_REFERENCE = 0x71,
+ TC_CLASSDESC = 0x72,
+ TC_OBJECT = 0x73,
+ TC_STRING = 0x74,
+ TC_ARRAY = 0x75,
+ TC_CLASS = 0x76,
+ TC_BLOCKDATA = 0x77,
+ TC_ENDBLOCKDATA = 0x78,
+ TC_RESET = 0x79,
+ TC_BLOCKDATALONG = 0x7a,
+ TC_EXCEPTION = 0x7B,
+ TC_LONGSTRING = 0x7C,
+ TC_PROXYCLASSDESC = 0x7D,
+ TC_ENUM = 0x7E,
+
+ TC_BASE = TC_NULL, // lowest value
+ TC_MAX = TC_ENUM // highest value
+};
+
+#endif // JAVAOBJECTSTREAMS_EJAVATYPECODE_H
\ No newline at end of file
diff --git a/include/JavaObject/EJavaFieldDescriptorType.h b/include/JavaObject/EPrimitiveTypeCode.h
similarity index 52%
rename from include/JavaObject/EJavaFieldDescriptorType.h
rename to include/JavaObject/EPrimitiveTypeCode.h
index 57f3f26..c9e1513 100644
--- a/include/JavaObject/EJavaFieldDescriptorType.h
+++ b/include/JavaObject/EPrimitiveTypeCode.h
@@ -11,17 +11,17 @@
#ifndef JAVAOBJECTSTREAMS_EJAVAFIELDDESCRIPTORTYPE_H
#define JAVAOBJECTSTREAMS_EJAVAFIELDDESCRIPTORTYPE_H
-enum EJavaFieldDescriptorType : signed char {
- TYPE_BYTE = 'B',
- TYPE_CHARACTER = 'C',
- TYPE_DOUBLE = 'D',
- TYPE_FLOAT = 'F',
- TYPE_INT = 'I',
- TYPE_LONG = 'J',
- TYPE_OBJECT = 'L',
- TYPE_SHORT = 'S',
- TYPE_BOOLEAN = 'Z',
- TYPE_ARRAY = '['
+enum class EPrimitiveTypeCode : signed char {
+ TYPE_BYTE = 'B',
+ TYPE_CHARACTER = 'C',
+ TYPE_DOUBLE = 'D',
+ TYPE_FLOAT = 'F',
+ TYPE_INT = 'I',
+ TYPE_LONG = 'J',
+ TYPE_OBJECT = 'L',
+ TYPE_SHORT = 'S',
+ TYPE_BOOLEAN = 'Z',
+ TYPE_ARRAY = '['
};
-#endif // JAVAOBJECTSTREAMS_EJAVAFIELDDESCRIPTORTYPE_H
+#endif // JAVAOBJECTSTREAMS_EJAVAFIELDDESCRIPTORTYPE_H
\ No newline at end of file
diff --git a/include/JavaObject/JavaSerializedClassParser.h b/include/JavaObject/JavaSerializedClassParser.h
deleted file mode 100644
index 9a571cd..0000000
--- a/include/JavaObject/JavaSerializedClassParser.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/** @file JavaSerializedClassParser.h
-*
-* @author Zero_DSRS_VX
-* @date 3/22/26
-*
-* @device mac-8
-*
-* @copyright Copyright (c) 2026 Team Lodestone
-* @license This project is licensed under the MIT license, see the LICENSE file for details.
-*/
-#ifndef JAVAOBJECTSTREAMS_JAVASERIALIZEDCLASSPARSER_H
-#define JAVAOBJECTSTREAMS_JAVASERIALIZEDCLASSPARSER_H
-#include
-#include
-
-#include "BinaryIO/stream/BinaryOutputStream.h"
-#include "JavaObject/EJavaFieldDescriptorType.h"
-
-namespace bio::stream {
- class BinaryInputStream;
-}
-
-namespace javaobject {
- class JavaSerializedClassParser;
- class SerializedClass;
- class SerializedField;
-
- struct JavaObject {
- SerializedClass &m_class;
- };
-
- class JavaArray;
-
- // DO NOT RE-ORDER VARIANTS
- using JavaValue = std::variant,
- std::string>;
-
- class JavaArray : public std::vector {
- public:
- JavaArray() = default;
-
- explicit JavaArray(const JavaValue &value) {
- this->emplace_back(value);
- };
- };
-
- class SerializedClass {
- public:
- std::string m_className;
-
- std::vector m_fields;
- };
-
- class SerializedField {
- public:
- const SerializedClass &m_class;
-
- EJavaFieldDescriptorType type;
- std::string name;
- std::string desc;
- JavaValue value;
-
- explicit SerializedField(const SerializedClass &clazz, const std::string &name,
- const EJavaFieldDescriptorType type, std::string &desc) : m_class(clazz), name(name),
- type(type), desc(desc) {
- }
-
- static SerializedField parseFieldEntry(const SerializedClass &clazz, bio::stream::BinaryInputStream &strm);
-
- static std::string parseSignature(const SerializedClass &clazz, char type,
- bio::stream::BinaryInputStream &strm);
-
- static JavaValue readFieldValue(JavaSerializedClassParser &parser, SerializedField &field,
- bio::stream::BinaryInputStream &strm);
-
- void setDescriptor(const std::string &desc);
- };
-
- class JavaSerializedClassParser {
- bio::stream::BinaryInputStream &m_stream;
- std::vector m_serializedClasses;
-
- public:
- explicit JavaSerializedClassParser(bio::stream::BinaryInputStream &strm) : m_stream(strm) {
- };
-
- std::vector parseAllEntries();
-
- SerializedClass parseEntry();
- };
-} // lodestone::minecraft::common::java::classic::minev3
-
-#endif //JAVAOBJECTSTREAMS_JAVASERIALIZEDCLASSPARSER_H
diff --git a/include/JavaObject/io/Serializable.h b/include/JavaObject/io/Serializable.h
index dc158da..9df66bf 100644
--- a/include/JavaObject/io/Serializable.h
+++ b/include/JavaObject/io/Serializable.h
@@ -10,18 +10,17 @@
*/
#ifndef JAVAOBJECTSTREAMS_SERIALIZABLE_H
#define JAVAOBJECTSTREAMS_SERIALIZABLE_H
-#include "JavaObject/JavaSerializedClassParser.h"
+// #include "JavaObject/JavaSerializedClassParser.h"
+//
+// namespace javaobject::io {
+// class Serializable {
+// public:
+// virtual ~Serializable() = default;
+//
+// virtual SerializedClass serializeObject() = 0;
+// // todo deserialize func too I think?
+// // or maybe we should be able to create a definition type (just types and names, no values) and pass that into deserializeObject with template to return correct class type
+// };
+// }
-namespace javaobject::io {
- class Serializable {
- public:
- virtual ~Serializable() = default;
-
- virtual SerializedClass serializeObject() = 0;
-
- // todo deserialize func too I think?
- // or maybe we should be able to create a definition type (just types and names, no values) and pass that into deserializeObject with template to return correct class type
- };
-}
-
-#endif // JAVAOBJECTSTREAMS_SERIALIZABLE_H
+#endif // JAVAOBJECTSTREAMS_SERIALIZABLE_H
\ No newline at end of file
diff --git a/include/JavaObject/stream/ObjectInputStream.h b/include/JavaObject/stream/ObjectInputStream.h
index d439e9d..f61cb37 100644
--- a/include/JavaObject/stream/ObjectInputStream.h
+++ b/include/JavaObject/stream/ObjectInputStream.h
@@ -10,7 +10,11 @@
*/
#ifndef JAVAOBJECTSTREAMS_OBJECTINPUTSTREAM_H
#define JAVAOBJECTSTREAMS_OBJECTINPUTSTREAM_H
+#include "../type/object/ObjectTypeCodeParser.h"
+#include "../type/object/types/IObject.h"
+
#include
+#include
// TODO
@@ -19,10 +23,16 @@ namespace javaobject::stream {
public:
explicit ObjectInputStream(std::istream &input);
- //todo
- // ObjectInputStream &operator>>(? value);
+ std::shared_ptr readObject();
+
+ ObjectInputStream &operator>>(std::shared_ptr &object);
private:
+ type::HandleContainer m_handleContainer;
+
std::istream &m_input;
+ bio::stream::BinaryInputStream m_stream;
+
+ type::TypeCodeParserStorage m_parsers;
};
//some people might prefer STL naming scheme for this, so why not:
diff --git a/include/JavaObject/type/HandleContainer.h b/include/JavaObject/type/HandleContainer.h
new file mode 100644
index 0000000..6d2fe5b
--- /dev/null
+++ b/include/JavaObject/type/HandleContainer.h
@@ -0,0 +1,35 @@
+/** @file HandleContainer.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/24/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_HANDLECONTAINER_H
+#define JAVAOBJECTSTREAMS_HANDLECONTAINER_H
+#include "JavaObject/type/object/types/IObject.h"
+#include "JavaObject/type/object/types/ReferenceObject.h"
+
+#include
+#include
+
+namespace javaobject::type {
+ class HandleContainer {
+ public:
+ void registerHandle(const std::shared_ptr &object);
+
+ std::shared_ptr resolveHandle(const object::ReferenceObject::handle_t handle);
+ std::shared_ptr resolveReference(const object::ReferenceObject *reference);
+ std::shared_ptr resolveReference(const std::shared_ptr &reference);
+
+ private:
+ /** Links handles to objects by pointer, these objects are expected to be stored already, otherwise it would leave a dangling/invalid pointer. */
+ std::unordered_map> m_handles;
+ object::ReferenceObject::handle_t m_nextHandle = 0x007E0000;
+ };
+} // namespace javaobject::type
+
+#endif // JAVAOBJECTSTREAMS_HANDLECONTAINER_H
diff --git a/include/JavaObject/type/ITypeCodeParser.h b/include/JavaObject/type/ITypeCodeParser.h
new file mode 100644
index 0000000..57e08b8
--- /dev/null
+++ b/include/JavaObject/type/ITypeCodeParser.h
@@ -0,0 +1,64 @@
+/** @file ITypeCodeParser.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/24/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_ITYPECODEPARSER_H
+#define JAVAOBJECTSTREAMS_ITYPECODEPARSER_H
+#include "BinaryIO/stream/BinaryInputStream.h"
+#include "JavaObject/type/HandleContainer.h"
+
+namespace javaobject::type {
+ template
+ class ITypeCodeParser {
+ public:
+ explicit ITypeCodeParser(std::istream &input, HandleContainer &handleContainer) : m_input(input), m_handleContainer(handleContainer) {}
+
+ virtual ~ITypeCodeParser() = default;
+
+ virtual std::shared_ptr readNext() = 0;
+ virtual std::shared_ptr readUsingParser(const ParserT &parser) = 0;
+
+ template
+ requires std::is_base_of_v
+ std::shared_ptr readNextAs() {
+ return std::static_pointer_cast(this->readNext());
+ }
+
+ template
+ requires std::is_base_of_v
+ std::shared_ptr readAsUsingParser(const ParserT &parser) {
+ return std::static_pointer_cast(this->readUsingParser(parser));
+ }
+
+ ParserT *getParser(const TypeCodeT typeCode) {
+ if (const auto it = m_parsers.find(typeCode); it != this->m_parsers.end()) {
+ return it->second.get();
+ }
+
+ return nullptr;
+ }
+
+ HandleContainer &handleContainer() {
+ return this->m_handleContainer;
+ }
+
+ bio::stream::BinaryInputStream &stream() {
+ return this->m_input;
+ }
+
+ protected:
+ /** Links typecodes to their parser class */
+ std::unordered_map> m_parsers;
+
+ bio::stream::BinaryInputStream m_input;
+ HandleContainer &m_handleContainer;
+ };
+} // namespace javaobject::type
+
+#endif // JAVAOBJECTSTREAMS_ITYPECODEPARSER_H
diff --git a/include/JavaObject/type/ITypeCodeStorageHolder.h b/include/JavaObject/type/ITypeCodeStorageHolder.h
new file mode 100644
index 0000000..811476f
--- /dev/null
+++ b/include/JavaObject/type/ITypeCodeStorageHolder.h
@@ -0,0 +1,27 @@
+/** @file ITypeCodeStorageHolder.h
+*
+* @author Zero_DSRS_VX
+* @date 3/25/26
+*
+* @device mac-8
+*
+* @copyright Copyright (c) 2026 Team Lodestone
+* @license This project is licensed under the LGPL 3.0 license, see the LICENSE file for details.
+*/
+#ifndef PROJECTLODESTONE_ITYPECODESTORAGEHOLDER_H
+#define PROJECTLODESTONE_ITYPECODESTORAGEHOLDER_H
+#include "TypeCodeParserStorage.h"
+
+namespace javaobject::type {
+ class ITypeCodeStorageHolder {
+ public:
+ explicit ITypeCodeStorageHolder(TypeCodeParserStorage &parserStorage);
+
+ TypeCodeParserStorage &parserStorage();
+
+ protected:
+ TypeCodeParserStorage &m_parserStorage;
+ };
+}
+
+#endif //PROJECTLODESTONE_ITYPECODESTORAGEHOLDER_H
diff --git a/include/JavaObject/type/TypeCodeParserStorage.h b/include/JavaObject/type/TypeCodeParserStorage.h
new file mode 100644
index 0000000..6cf97dd
--- /dev/null
+++ b/include/JavaObject/type/TypeCodeParserStorage.h
@@ -0,0 +1,31 @@
+/** @file TypeCodeParserStorage.h
+*
+* @author Zero_DSRS_VX
+* @date 3/25/26
+*
+* @device mac-8
+*
+* @copyright Copyright (c) 2026 Team Lodestone
+* @license This project is licensed under the LGPL 3.0 license, see the LICENSE file for details.
+*/
+#ifndef PROJECTLODESTONE_TYPECODESTORAGE_H
+#define PROJECTLODESTONE_TYPECODESTORAGE_H
+#include
+
+
+namespace javaobject::type {
+ namespace object {
+ class ObjectTypeCodeParser;
+ }
+
+ namespace primitive {
+ class PrimitiveTypeCodeParser;
+ }
+
+ struct TypeCodeParserStorage {
+ std::shared_ptr primitiveParser;
+ std::shared_ptr objectParser;
+ };
+}
+
+#endif //PROJECTLODESTONE_TYPECODESTORAGE_H
diff --git a/include/JavaObject/type/object/ObjectTypeCodeParser.h b/include/JavaObject/type/object/ObjectTypeCodeParser.h
new file mode 100644
index 0000000..317ba6f
--- /dev/null
+++ b/include/JavaObject/type/object/ObjectTypeCodeParser.h
@@ -0,0 +1,41 @@
+/** @file TypeCode.h
+ *
+ * @author DexrnZacAttack
+ * @date 3/24/26
+ *
+ * @device zPc-i2
+ */
+#ifndef JAVAOBJECTSTREAMS_TYPECODE_H
+#define JAVAOBJECTSTREAMS_TYPECODE_H
+#include "BinaryIO/stream/BinaryInputStream.h"
+#include "JavaObject/EObjectTypeCode.h"
+#include "JavaObject/type/HandleContainer.h"
+#include "JavaObject/type/ITypeCodeParser.h"
+#include "JavaObject/type/object/parsers/IObjectParser.h"
+#include "JavaObject/type/object/parsers/ReferenceParser.h"
+#include "JavaObject/util/SmartPointerCast.h"
+#include "types/ReferenceObject.h"
+
+#include
+#include
+#include
+#include
+#include
+
+#include "JavaObject/type/ITypeCodeStorageHolder.h"
+
+namespace javaobject::type::primitive {
+ class PrimitiveTypeCodeParser;
+}
+
+namespace javaobject::type::object {
+ class ObjectTypeCodeParser : public ITypeCodeParser, public ITypeCodeStorageHolder {
+ public:
+ explicit ObjectTypeCodeParser(std::istream &input, HandleContainer &handleContainer, TypeCodeParserStorage &parserStorage);
+
+ std::shared_ptr readNext() override;
+ std::shared_ptr readUsingParser(const object::parsers::IObjectParser &parser) override;
+ };
+} // namespace javaobject::type
+
+#endif // JAVAOBJECTSTREAMS_TYPECODE_H
\ No newline at end of file
diff --git a/include/JavaObject/type/object/parsers/ArrayObjectParser.h b/include/JavaObject/type/object/parsers/ArrayObjectParser.h
new file mode 100644
index 0000000..ba76ddc
--- /dev/null
+++ b/include/JavaObject/type/object/parsers/ArrayObjectParser.h
@@ -0,0 +1,22 @@
+/** @file ArrayObjectParser.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/25/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_ARRAYOBJECTPARSER_H
+#define JAVAOBJECTSTREAMS_ARRAYOBJECTPARSER_H
+#include "JavaObject/type/object/parsers/IObjectParser.h"
+
+namespace javaobject::type::object::parsers {
+ // the c lion does not concern itself with compiler errors
+ struct ArrayObjectParser : IObjectParser {
+ std::shared_ptr operator()(type::object::ObjectTypeCodeParser &parser) const override;
+ };
+} // namespace javaobject::type::object::parsers
+
+#endif // JAVAOBJECTSTREAMS_ARRAYOBJECTPARSER_H
diff --git a/include/JavaObject/type/object/parsers/ClassDataParser.h b/include/JavaObject/type/object/parsers/ClassDataParser.h
new file mode 100644
index 0000000..c633f1e
--- /dev/null
+++ b/include/JavaObject/type/object/parsers/ClassDataParser.h
@@ -0,0 +1,36 @@
+/** @file ClassDataParser.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/24/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_CLASSDATAPARSER_H
+#define JAVAOBJECTSTREAMS_CLASSDATAPARSER_H
+#include "../types/ClassDataObject.h"
+#include "JavaObject/type/object/parsers/IObjectParser.h"
+
+#include
+
+#include "JavaObject/type/object/types/descriptor/ClassDescriptorInfoObject.h"
+
+namespace javaobject::type::object::parsers {
+ struct ClassDataParser : public IObjectParser {
+ explicit ClassDataParser(const std::shared_ptr &classDescInfo);
+
+ std::shared_ptr operator()(type::object::ObjectTypeCodeParser &parser) const override;
+
+ std::shared_ptr parseSerializableClassData(type::object::ObjectTypeCodeParser &parser) const;
+ std::shared_ptr parseSerializableWriteMethodClassData(type::object::ObjectTypeCodeParser &parser) const;
+ std::shared_ptr parseExternalizableClassData(type::object::ObjectTypeCodeParser &parser) const;
+ std::shared_ptr parseExternalizableBlockDataClassData(type::object::ObjectTypeCodeParser &parser) const;
+
+ private:
+ const std::shared_ptr m_classDescInfo;
+ };
+} // namespace javaobject::type::object::parsers
+
+#endif // JAVAOBJECTSTREAMS_CLASSDATAPARSER_H
diff --git a/include/JavaObject/type/object/parsers/EndBlockDataObjectParser.h b/include/JavaObject/type/object/parsers/EndBlockDataObjectParser.h
new file mode 100644
index 0000000..22a51bc
--- /dev/null
+++ b/include/JavaObject/type/object/parsers/EndBlockDataObjectParser.h
@@ -0,0 +1,21 @@
+/** @file EndBlockDataObjectParser.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/25/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_ENDBLOCKDATAOBJECTPARSER_H
+#define JAVAOBJECTSTREAMS_ENDBLOCKDATAOBJECTPARSER_H
+#include "IObjectParser.h"
+
+namespace javaobject::type::object::parsers {
+ struct EndBlockDataObjectParser : IObjectParser {
+ std::shared_ptr operator()(type::object::ObjectTypeCodeParser& parser) const override;
+ };
+}
+
+#endif //JAVAOBJECTSTREAMS_ENDBLOCKDATAOBJECTPARSER_H
diff --git a/include/JavaObject/type/object/parsers/IObjectParser.h b/include/JavaObject/type/object/parsers/IObjectParser.h
new file mode 100644
index 0000000..bb3375b
--- /dev/null
+++ b/include/JavaObject/type/object/parsers/IObjectParser.h
@@ -0,0 +1,31 @@
+/** @file IObjectParser.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/24/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file
+ * for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_IOBJECTPARSER_H
+#define JAVAOBJECTSTREAMS_IOBJECTPARSER_H
+#include "JavaObject/type/object/types/IObject.h"
+
+#include
+
+namespace javaobject::type::object {
+ class ObjectTypeCodeParser;
+}
+
+namespace javaobject::type::object::parsers {
+ class IObjectParser {
+ public:
+ virtual ~IObjectParser() = default;
+
+ virtual std::shared_ptr operator()(type::object::ObjectTypeCodeParser &parser) const = 0;
+ };
+} // namespace javaobject::type::object::parsers
+
+#endif // JAVAOBJECTSTREAMS_IOBJECTPARSER_H
diff --git a/include/JavaObject/type/object/parsers/LongBlockDataObjectParser.h b/include/JavaObject/type/object/parsers/LongBlockDataObjectParser.h
new file mode 100644
index 0000000..9246fcd
--- /dev/null
+++ b/include/JavaObject/type/object/parsers/LongBlockDataObjectParser.h
@@ -0,0 +1,21 @@
+/** @file LongBlockDataObjectParser.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/25/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_LONGBLOCKDATAOBJECTPARSER_H
+#define JAVAOBJECTSTREAMS_LONGBLOCKDATAOBJECTPARSER_H
+#include "JavaObject/type/object/parsers/IObjectParser.h"
+
+namespace javaobject::type::object::parsers {
+ struct LongBlockDataObjectParser : IObjectParser {
+ std::shared_ptr operator()(type::object::ObjectTypeCodeParser& parser) const override;
+ };
+}
+
+#endif //JAVAOBJECTSTREAMS_LONGBLOCKDATAOBJECTPARSER_H
diff --git a/include/JavaObject/type/object/parsers/NewClassParser.h b/include/JavaObject/type/object/parsers/NewClassParser.h
new file mode 100644
index 0000000..6ad6fb6
--- /dev/null
+++ b/include/JavaObject/type/object/parsers/NewClassParser.h
@@ -0,0 +1,22 @@
+/** @file NewClassParser.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/24/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_NEWCLASSPARSER_H
+#define JAVAOBJECTSTREAMS_NEWCLASSPARSER_H
+
+namespace javaobject {
+ namespace type {
+ namespace parser {
+ class NewClassParser {};
+ } // namespace parser
+ } // namespace type
+} // namespace javaobject
+
+#endif // JAVAOBJECTSTREAMS_NEWCLASSPARSER_H
diff --git a/include/JavaObject/type/object/parsers/NullObjectParser.h b/include/JavaObject/type/object/parsers/NullObjectParser.h
new file mode 100644
index 0000000..925c856
--- /dev/null
+++ b/include/JavaObject/type/object/parsers/NullObjectParser.h
@@ -0,0 +1,21 @@
+/** @file NullObjectParser.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/25/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_NULLOBJECTPARSER_H
+#define JAVAOBJECTSTREAMS_NULLOBJECTPARSER_H
+#include "IObjectParser.h"
+
+namespace javaobject::type::object::parsers {
+ struct NullObjectParser : IObjectParser {
+ std::shared_ptr operator()(type::object::ObjectTypeCodeParser& parser) const override;
+ };
+}
+
+#endif //JAVAOBJECTSTREAMS_NULLOBJECTPARSER_H
diff --git a/include/JavaObject/type/object/parsers/ObjectParser.h b/include/JavaObject/type/object/parsers/ObjectParser.h
new file mode 100644
index 0000000..da987fd
--- /dev/null
+++ b/include/JavaObject/type/object/parsers/ObjectParser.h
@@ -0,0 +1,24 @@
+/** @file ObjectParser.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/24/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file
+ * for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_OBJECTPARSER_H
+#define JAVAOBJECTSTREAMS_OBJECTPARSER_H
+#include "JavaObject/type/object/parsers/IObjectParser.h"
+
+namespace javaobject::type::object::parsers {
+ class ObjectParser : public IObjectParser {
+ public:
+ std::shared_ptr
+ operator()(type::object::ObjectTypeCodeParser &parser) const override;
+ };
+} // namespace javaobject::type::object::parsers
+
+#endif // JAVAOBJECTSTREAMS_OBJECTPARSER_H
diff --git a/include/JavaObject/type/object/parsers/ReferenceParser.h b/include/JavaObject/type/object/parsers/ReferenceParser.h
new file mode 100644
index 0000000..f293f72
--- /dev/null
+++ b/include/JavaObject/type/object/parsers/ReferenceParser.h
@@ -0,0 +1,21 @@
+/** @file ReferenceParser.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/24/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_REFERENCEPARSER_H
+#define JAVAOBJECTSTREAMS_REFERENCEPARSER_H
+#include "JavaObject/type/object/parsers/IObjectParser.h"
+
+namespace javaobject::type::object::parsers {
+ struct ReferenceParser : public IObjectParser {
+ std::shared_ptr operator()(type::object::ObjectTypeCodeParser &parser) const override;
+ };
+} // namespace javaobject::type::object::parsers
+
+#endif // JAVAOBJECTSTREAMS_REFERENCEPARSER_H
diff --git a/include/JavaObject/type/object/parsers/ShortBlockDataObjectParser.h b/include/JavaObject/type/object/parsers/ShortBlockDataObjectParser.h
new file mode 100644
index 0000000..9645643
--- /dev/null
+++ b/include/JavaObject/type/object/parsers/ShortBlockDataObjectParser.h
@@ -0,0 +1,21 @@
+/** @file BlockDataObjectParser.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/25/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_BLOCKDATAOBJECTPARSER_H
+#define JAVAOBJECTSTREAMS_BLOCKDATAOBJECTPARSER_H
+#include "IObjectParser.h"
+
+namespace javaobject::type::object::parsers {
+ struct ShortBlockDataObjectParser : IObjectParser {
+ std::shared_ptr operator()(type::object::ObjectTypeCodeParser& parser) const override;
+ };
+}
+
+#endif //JAVAOBJECTSTREAMS_BLOCKDATAOBJECTPARSER_H
diff --git a/include/JavaObject/type/object/parsers/StringParser.h b/include/JavaObject/type/object/parsers/StringParser.h
new file mode 100644
index 0000000..6096540
--- /dev/null
+++ b/include/JavaObject/type/object/parsers/StringParser.h
@@ -0,0 +1,23 @@
+/** @file StringParser.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/24/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file
+ * for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_STRINGPARSER_H
+#define JAVAOBJECTSTREAMS_STRINGPARSER_H
+#include "JavaObject/type/object/parsers/IObjectParser.h"
+
+namespace javaobject::type::object::parsers {
+ class StringParser : public IObjectParser {
+ public:
+ std::shared_ptr operator()(type::object::ObjectTypeCodeParser &parser) const override;
+ };
+} // namespace javaobject::type::object::parsers
+
+#endif // JAVAOBJECTSTREAMS_STRINGPARSER_H
diff --git a/include/JavaObject/type/object/parsers/descriptor/ClassDescriptorInfoParser.h b/include/JavaObject/type/object/parsers/descriptor/ClassDescriptorInfoParser.h
new file mode 100644
index 0000000..d586b42
--- /dev/null
+++ b/include/JavaObject/type/object/parsers/descriptor/ClassDescriptorInfoParser.h
@@ -0,0 +1,27 @@
+/** @file ClassDescriptorInfoParser.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/24/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file
+ * for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_CLASSDESCRIPTORINFOPARSER_H
+#define JAVAOBJECTSTREAMS_CLASSDESCRIPTORINFOPARSER_H
+#include "JavaObject/type/object/parsers/IObjectParser.h"
+
+namespace javaobject::type::object {
+ class ObjectTypeCodeParser;
+}
+namespace javaobject::type::object::parsers::descriptor {
+ class ClassDescriptorInfoParser : public IObjectParser {
+ public:
+ std::shared_ptr
+ operator()(type::object::ObjectTypeCodeParser &parser) const override;
+ };
+} // namespace javaobject::type::object::parsers::descriptor
+
+#endif // JAVAOBJECTSTREAMS_CLASSDESCRIPTORINFOPARSER_H
diff --git a/include/JavaObject/type/object/parsers/descriptor/FieldDescriptorParser.h b/include/JavaObject/type/object/parsers/descriptor/FieldDescriptorParser.h
new file mode 100644
index 0000000..d3764fe
--- /dev/null
+++ b/include/JavaObject/type/object/parsers/descriptor/FieldDescriptorParser.h
@@ -0,0 +1,25 @@
+/** @file FieldDescriptorParser.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/24/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file
+ * for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_FIELDDESCRIPTORPARSER_H
+#define JAVAOBJECTSTREAMS_FIELDDESCRIPTORPARSER_H
+#include "JavaObject/type/object/ObjectTypeCodeParser.h"
+#include "JavaObject/type/object/parsers/IObjectParser.h"
+
+namespace javaobject::type::object::parsers::descriptor {
+ class FieldDescriptorParser : public IObjectParser {
+ public:
+ std::shared_ptr
+ operator()(type::object::ObjectTypeCodeParser &parser) const override;
+ };
+} // namespace javaobject::type::object::parsers::descriptor
+
+#endif // JAVAOBJECTSTREAMS_FIELDDESCRIPTORPARSER_H
diff --git a/include/JavaObject/type/object/parsers/descriptor/NewClassDescriptorParser.h b/include/JavaObject/type/object/parsers/descriptor/NewClassDescriptorParser.h
new file mode 100644
index 0000000..de4bdff
--- /dev/null
+++ b/include/JavaObject/type/object/parsers/descriptor/NewClassDescriptorParser.h
@@ -0,0 +1,26 @@
+/** @file NewClassDescriptorParser.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/24/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file
+ * for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_NEWCLASSDESCRIPTORPARSER_H
+#define JAVAOBJECTSTREAMS_NEWCLASSDESCRIPTORPARSER_H
+#include "JavaObject/type/object/parsers/IObjectParser.h"
+
+namespace javaobject::type::object::parsers::descriptor {
+
+ class NewClassDescriptorParser : public IObjectParser {
+ public:
+ std::shared_ptr
+ operator()(type::object::ObjectTypeCodeParser &parser) const override;
+ };
+
+} // namespace javaobject::type::object::parsers::descriptor
+
+#endif // JAVAOBJECTSTREAMS_CLASSDESCRIPTORPARSER_H
diff --git a/include/JavaObject/type/object/parsers/descriptor/PrimitiveDescriptorParser.h b/include/JavaObject/type/object/parsers/descriptor/PrimitiveDescriptorParser.h
new file mode 100644
index 0000000..604e931
--- /dev/null
+++ b/include/JavaObject/type/object/parsers/descriptor/PrimitiveDescriptorParser.h
@@ -0,0 +1,23 @@
+/** @file PrimitiveDescriptorParser.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/24/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file
+ * for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_PRIMITIVEDESCRIPTORPARSER_H
+#define JAVAOBJECTSTREAMS_PRIMITIVEDESCRIPTORPARSER_H
+#include "JavaObject/type/object/parsers/IObjectParser.h"
+
+namespace javaobject::type::object::parsers::descriptor {
+ class PrimitiveDescriptorParser : public IObjectParser {
+ public:
+ std::shared_ptr operator()(type::object::ObjectTypeCodeParser &parser) const override;
+ };
+} // namespace javaobject::type::object::parsers::descriptor
+
+#endif // JAVAOBJECTSTREAMS_PRIMITIVEDESCRIPTORPARSER_H
diff --git a/include/JavaObject/type/object/types/AnnotationObject.h b/include/JavaObject/type/object/types/AnnotationObject.h
new file mode 100644
index 0000000..e279d60
--- /dev/null
+++ b/include/JavaObject/type/object/types/AnnotationObject.h
@@ -0,0 +1,26 @@
+/** @file AnnotationObject.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/24/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_ANNOTATIONOBJECT_H
+#define JAVAOBJECTSTREAMS_ANNOTATIONOBJECT_H
+#include "IObject.h"
+
+#include
+#include
+
+namespace javaobject::type::object {
+ struct AnnotationObject : IObject {
+ explicit AnnotationObject(const std::vector>& contents) : contents(contents) {}
+
+ std::vector> contents;
+ };
+} // namespace javaobject::type::object
+
+#endif // JAVAOBJECTSTREAMS_ANNOTATIONOBJECT_H
diff --git a/include/JavaObject/type/object/types/ArrayObject.h b/include/JavaObject/type/object/types/ArrayObject.h
new file mode 100644
index 0000000..fd288a2
--- /dev/null
+++ b/include/JavaObject/type/object/types/ArrayObject.h
@@ -0,0 +1,36 @@
+/** @file ArrayObject.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/25/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_ARRAYOBJECT_H
+#define JAVAOBJECTSTREAMS_ARRAYOBJECT_H
+#include "BinaryIO/container/FixedArray.h"
+#include "JavaObject/type/object/types/IObject.h"
+#include "JavaObject/type/object/types/descriptor/NewClassDescriptorObject.h"
+#include "JavaObject/type/primitive/types/IPrimitiveObject.h"
+
+#include
+#include
+
+namespace javaobject::type::object::types {
+ struct ArrayObject : IObject {
+ ArrayObject(const std::shared_ptr &typeDescriptor, const std::vector> &values)
+ : typeDescriptor(typeDescriptor), values(values) {}
+
+ explicit ArrayObject(const std::shared_ptr &typeDescriptor)
+ : typeDescriptor(typeDescriptor) {}
+
+ std::string toString() override;
+
+ std::shared_ptr typeDescriptor;
+ std::vector> values;
+ };
+} // namespace javaobject::type::object::types
+
+#endif // JAVAOBJECTSTREAMS_ARRAYOBJECT_H
diff --git a/include/JavaObject/type/object/types/BlockDataObject.h b/include/JavaObject/type/object/types/BlockDataObject.h
new file mode 100644
index 0000000..b134c4e
--- /dev/null
+++ b/include/JavaObject/type/object/types/BlockDataObject.h
@@ -0,0 +1,28 @@
+/** @file BlockDataObject.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/25/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_BLOCKDATAOBJECT_H
+#define JAVAOBJECTSTREAMS_BLOCKDATAOBJECT_H
+#include
+#include
+
+#include "IObject.h"
+
+namespace javaobject::type::object::parsers {
+ struct BlockDataObject : IObject {
+ explicit BlockDataObject(const std::vector& data)
+ : data(data) {
+ }
+
+ std::vector data;
+ };
+}
+
+#endif //JAVAOBJECTSTREAMS_BLOCKDATAOBJECT_H
diff --git a/include/JavaObject/type/object/types/ClassDataObject.h b/include/JavaObject/type/object/types/ClassDataObject.h
new file mode 100644
index 0000000..97aad20
--- /dev/null
+++ b/include/JavaObject/type/object/types/ClassDataObject.h
@@ -0,0 +1,74 @@
+/** @file ClassDataObject.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/24/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_CLASSDATAOBJECT_H
+#define JAVAOBJECTSTREAMS_CLASSDATAOBJECT_H
+#include "AnnotationObject.h"
+#include "IObject.h"
+#include "JavaObject/type/primitive/types/IPrimitiveObject.h"
+
+#include
+#include
+#include
+
+namespace javaobject::type::object
+{
+ struct ClassDataObject : public IObject
+ {
+ };
+
+ //nowrclass
+ struct SerializableClassDataObject : public ClassDataObject
+ {
+ SerializableClassDataObject() = default;
+
+ explicit SerializableClassDataObject(
+ const std::unordered_map>&
+ values) : values(values)
+ {
+ }
+
+ std::unordered_map> values;
+ };
+
+ //wrclass, objectAnnotation
+ struct SerializableWriteMethodClassDataObject : public SerializableClassDataObject
+ {
+ SerializableWriteMethodClassDataObject(
+ const std::shared_ptr& base,
+ const std::shared_ptr& annotation)
+ : SerializableClassDataObject(*base), annotation(annotation)
+ {
+ }
+
+ SerializableWriteMethodClassDataObject(
+ const std::unordered_map>& values,
+ const std::shared_ptr& annotation)
+ : SerializableClassDataObject(values), annotation(annotation)
+ {
+ }
+
+ std::shared_ptr annotation;
+ };
+
+ //externalContents
+ struct ExternalizableClassDataObject : ClassDataObject
+ {
+ //TODO
+ };
+
+ //objectAnnotation
+ struct ExternalizableBlockDataClassDataObject : ClassDataObject
+ {
+ // TODO
+ };
+} // namespace javaobject::type::object
+
+#endif // JAVAOBJECTSTREAMS_CLASSDATAOBJECT_H
diff --git a/include/JavaObject/type/object/types/EndBlockDataObject.h b/include/JavaObject/type/object/types/EndBlockDataObject.h
new file mode 100644
index 0000000..e136aae
--- /dev/null
+++ b/include/JavaObject/type/object/types/EndBlockDataObject.h
@@ -0,0 +1,19 @@
+/** @file EndBlockDataObject.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/25/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_ENDBLOCKDATAOBJECT_H
+#define JAVAOBJECTSTREAMS_ENDBLOCKDATAOBJECT_H
+#include "JavaObject/type/object/types/IObject.h"
+
+namespace javaobject::type::object::types {
+ struct EndBlockDataObject : IObject {};
+}
+
+#endif //JAVAOBJECTSTREAMS_ENDBLOCKDATAOBJECT_H
diff --git a/include/JavaObject/type/object/types/IObject.h b/include/JavaObject/type/object/types/IObject.h
new file mode 100644
index 0000000..0ac76ad
--- /dev/null
+++ b/include/JavaObject/type/object/types/IObject.h
@@ -0,0 +1,26 @@
+/** @file IObject.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/24/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file
+ * for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_IOBJECT_H
+#define JAVAOBJECTSTREAMS_IOBJECT_H
+
+#include
+
+namespace javaobject::type::object {
+ class IObject {
+ public:
+ virtual ~IObject() = default;
+
+ virtual std::string toString();
+ };
+} // namespace javaobject::type::object
+
+#endif // JAVAOBJECTSTREAMS_IOBJECT_H
diff --git a/include/JavaObject/type/object/types/NullObject.h b/include/JavaObject/type/object/types/NullObject.h
new file mode 100644
index 0000000..8c3c330
--- /dev/null
+++ b/include/JavaObject/type/object/types/NullObject.h
@@ -0,0 +1,22 @@
+/** @file NullObject.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/24/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file
+ * for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_NULLOBJECT_H
+#define JAVAOBJECTSTREAMS_NULLOBJECT_H
+#include "IObject.h"
+
+namespace javaobject::type::object {
+ class NullObject : public IObject {
+ std::string toString() override;
+ };
+} // namespace javaobject::type::object
+
+#endif // JAVAOBJECTSTREAMS_NULLOBJECT_H
diff --git a/include/JavaObject/type/object/types/Object.h b/include/JavaObject/type/object/types/Object.h
new file mode 100644
index 0000000..97f0ab0
--- /dev/null
+++ b/include/JavaObject/type/object/types/Object.h
@@ -0,0 +1,28 @@
+/** @file Object.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/24/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file
+ * for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_OBJECT_H
+#define JAVAOBJECTSTREAMS_OBJECT_H
+#include "IObject.h"
+#include "NullObject.h"
+
+#include
+
+namespace javaobject::type::object {
+ struct Object : public IObject {
+ Object(std::shared_ptr &&clazz, std::shared_ptr &&classData);
+
+ std::shared_ptr clazz;
+ std::shared_ptr classData; // todo use right type
+ };
+} // namespace javaobject::type::object
+
+#endif // JAVAOBJECTSTREAMS_OBJECT_H
diff --git a/include/JavaObject/type/object/types/ReferenceObject.h b/include/JavaObject/type/object/types/ReferenceObject.h
new file mode 100644
index 0000000..6649bf6
--- /dev/null
+++ b/include/JavaObject/type/object/types/ReferenceObject.h
@@ -0,0 +1,29 @@
+/** @file ReferenceObject.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/24/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_REFERENCEOBJECT_H
+#define JAVAOBJECTSTREAMS_REFERENCEOBJECT_H
+#include "IObject.h"
+
+#include
+
+namespace javaobject::type::object {
+ struct ReferenceObject : public IObject {
+ using handle_t = std::int32_t;
+
+ explicit ReferenceObject(const handle_t handle) : handle(handle) {}
+
+ std::string toString() override;
+
+ handle_t handle;
+ };
+} // namespace javaobject::type::object
+
+#endif // JAVAOBJECTSTREAMS_REFERENCEOBJECT_H
diff --git a/include/JavaObject/type/object/types/StringObject.h b/include/JavaObject/type/object/types/StringObject.h
new file mode 100644
index 0000000..f313f2b
--- /dev/null
+++ b/include/JavaObject/type/object/types/StringObject.h
@@ -0,0 +1,28 @@
+/** @file StringObject.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/24/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file
+ * for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_STRINGOBJECT_H
+#define JAVAOBJECTSTREAMS_STRINGOBJECT_H
+#include "IObject.h"
+
+#include
+
+namespace javaobject::type::object {
+ struct StringObject : public IObject {
+ explicit StringObject(const std::string &value);
+
+ std::string toString() override;
+
+ std::string value;
+ };
+} // namespace javaobject::type::object
+
+#endif // JAVAOBJECTSTREAMS_STRINGOBJECT_H
diff --git a/include/JavaObject/type/object/types/descriptor/ClassDescriptorInfoObject.h b/include/JavaObject/type/object/types/descriptor/ClassDescriptorInfoObject.h
new file mode 100644
index 0000000..2545412
--- /dev/null
+++ b/include/JavaObject/type/object/types/descriptor/ClassDescriptorInfoObject.h
@@ -0,0 +1,48 @@
+/** @file ClassDescriptorInfoObject.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/24/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_CLASSDESCRIPTORINFO_H
+#define JAVAOBJECTSTREAMS_CLASSDESCRIPTORINFO_H
+#include "JavaObject/type/object/types/IObject.h"
+#include "JavaObject/type/object/types/descriptor/FieldDescriptorObject.h"
+
+#include
+#include
+#include
+#include
+
+namespace javaobject::type::object::descriptor {
+ struct ClassDescriptorInfoObject : public IObject {
+ ClassDescriptorInfoObject(const std::int8_t flags, std::vector>> fields, std::shared_ptr classAnnotation,
+ std::shared_ptr superClassDescriptor)
+ : flags(flags), fields(std::move(fields)), classAnnotation(std::move(classAnnotation)),
+ superClassDescriptor(std::move(superClassDescriptor)) {}
+
+ enum Flags : std::int8_t {
+ SC_WRITE_METHOD = 0x01,
+ SC_BLOCK_DATA = 0x08,
+ SC_SERIALIZABLE = 0x02,
+ SC_EXTERNALIZABLE = 0x04,
+ SC_ENUM = 0x10
+ };
+
+ std::string toString() override;
+
+ std::int8_t flags;
+ // field -> value
+ // nvm since we have to store field values separately, we will just key them by field name there.
+ std::vector>> fields; // TODO yoink map that preserves insert order later
+ std::shared_ptr classAnnotation;
+
+ std::shared_ptr superClassDescriptor;
+ };
+} // namespace javaobject::type::object::descriptor
+
+#endif // JAVAOBJECTSTREAMS_CLASSDESCRIPTORINFO_H
diff --git a/include/JavaObject/type/object/types/descriptor/FieldDescriptorObject.h b/include/JavaObject/type/object/types/descriptor/FieldDescriptorObject.h
new file mode 100644
index 0000000..f37dfc3
--- /dev/null
+++ b/include/JavaObject/type/object/types/descriptor/FieldDescriptorObject.h
@@ -0,0 +1,30 @@
+/** @file FieldDescriptorObject.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/24/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file
+ * for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_FIELDDESCRIPTOROBJECT_H
+#define JAVAOBJECTSTREAMS_FIELDDESCRIPTOROBJECT_H
+#include "JavaObject/type/object/types/IObject.h"
+#include "JavaObject/type/object/types/descriptor/PrimitiveDescriptorObject.h"
+
+#include
+
+namespace javaobject::type::object::descriptor {
+ struct FieldDescriptorObject : public IObject {
+ FieldDescriptorObject(std::shared_ptr &&primitiveDescriptor, std::shared_ptr &&objectDescriptor)
+ : primitiveDescriptor(std::move(primitiveDescriptor)),
+ objectDescriptor(std::move(objectDescriptor)) {}
+
+ std::shared_ptr primitiveDescriptor;
+ std::shared_ptr objectDescriptor; // nullptr if primitive type is not OBJECT, ARRAY
+ };
+} // namespace javaobject::type::object::descriptor
+
+#endif // JAVAOBJECTSTREAMS_FIELDDESCRIPTOROBJECT_H
diff --git a/include/JavaObject/type/object/types/descriptor/NewClassDescriptorObject.h b/include/JavaObject/type/object/types/descriptor/NewClassDescriptorObject.h
new file mode 100644
index 0000000..226623a
--- /dev/null
+++ b/include/JavaObject/type/object/types/descriptor/NewClassDescriptorObject.h
@@ -0,0 +1,43 @@
+/** @file ClassDescriptorObject.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/24/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file
+ * for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_NEWCLASSDESCRIPTOROBJECT_H
+#define JAVAOBJECTSTREAMS_NEWCLASSDESCRIPTOROBJECT_H
+#include "JavaObject/type/object/types/IObject.h"
+#include "JavaObject/type/object/types/descriptor/ClassDescriptorInfoObject.h"
+#include "JavaObject/type/object/types/descriptor/FieldDescriptorObject.h"
+
+#include
+#include
+#include
+#include
+#include
+
+namespace javaobject::type::object::descriptor {
+ class NewProxyClassDescriptorObject : public IObject {
+ // TODO
+ };
+
+ struct NewClassDescriptorObject : IObject {
+ public:
+ NewClassDescriptorObject(const std::string &name, const std::uint64_t serialVersionUid, std::shared_ptr info)
+ : name(name), serialVersionUid(serialVersionUid), info(std::move(info)) {}
+
+ std::string toString() override;
+
+ std::string name;
+ std::uint64_t serialVersionUid;
+
+ std::shared_ptr info;
+ };
+} // namespace javaobject::type::object::descriptor
+
+#endif // JAVAOBJECTSTREAMS_CLASSDESCRIPTOROBJECT_H
diff --git a/include/JavaObject/type/object/types/descriptor/PrimitiveDescriptorObject.h b/include/JavaObject/type/object/types/descriptor/PrimitiveDescriptorObject.h
new file mode 100644
index 0000000..cf9f43b
--- /dev/null
+++ b/include/JavaObject/type/object/types/descriptor/PrimitiveDescriptorObject.h
@@ -0,0 +1,28 @@
+/** @file PrimitiveDescriptorObject.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/24/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file
+ * for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_PRIMITIVEDESCRIPTOROBJECT_H
+#define JAVAOBJECTSTREAMS_PRIMITIVEDESCRIPTOROBJECT_H
+#include "JavaObject/type/object/types/IObject.h"
+#include "JavaObject/EPrimitiveTypeCode.h"
+
+#include
+
+namespace javaobject::type::object::descriptor {
+ struct PrimitiveDescriptorObject : public IObject {
+ PrimitiveDescriptorObject(const EPrimitiveTypeCode typeCode, const std::string &name) : typeCode(typeCode), name(name) {}
+
+ EPrimitiveTypeCode typeCode;
+ std::string name;
+ };
+} // namespace javaobject::type::object::descriptor
+
+#endif // JAVAOBJECTSTREAMS_PRIMITIVEDESCRIPTOROBJECT_H
diff --git a/include/JavaObject/type/primitive/PrimitiveTypeCodeParser.h b/include/JavaObject/type/primitive/PrimitiveTypeCodeParser.h
new file mode 100644
index 0000000..a408188
--- /dev/null
+++ b/include/JavaObject/type/primitive/PrimitiveTypeCodeParser.h
@@ -0,0 +1,39 @@
+/** @file PrimitiveTypeCodeParser.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/24/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_PRIMITIVETYPECODEPARSER_H
+#define JAVAOBJECTSTREAMS_PRIMITIVETYPECODEPARSER_H
+#include "BinaryIO/stream/BinaryInputStream.h"
+#include "JavaObject/EPrimitiveTypeCode.h"
+#include "JavaObject/type/HandleContainer.h"
+#include "JavaObject/type/ITypeCodeParser.h"
+#include "JavaObject/type/primitive/parsers/IPrimitiveObjectParser.h"
+#include "JavaObject/type/primitive/types/IPrimitiveObject.h"
+
+#include
+
+#include "JavaObject/type/ITypeCodeStorageHolder.h"
+#include "JavaObject/type/TypeCodeParserStorage.h"
+
+namespace javaobject::type::object {
+ class ObjectTypeCodeParser;
+}
+
+namespace javaobject::type::primitive {
+ class PrimitiveTypeCodeParser : public ITypeCodeParser, public ITypeCodeStorageHolder {
+ public:
+ PrimitiveTypeCodeParser(std::istream &input, HandleContainer &handleContainer, TypeCodeParserStorage &parserStorage);
+
+ std::shared_ptr readNext() override;
+ std::shared_ptr readUsingParser(const parsers::IPrimitiveObjectParser &parser) override;
+ };
+} // namespace javaobject::type::primitive
+
+#endif // JAVAOBJECTSTREAMS_PRIMITIVETYPECODEPARSER_H
diff --git a/include/JavaObject/type/primitive/parsers/IPrimitiveObjectParser.h b/include/JavaObject/type/primitive/parsers/IPrimitiveObjectParser.h
new file mode 100644
index 0000000..28bcdf7
--- /dev/null
+++ b/include/JavaObject/type/primitive/parsers/IPrimitiveObjectParser.h
@@ -0,0 +1,31 @@
+/** @file IPrimitiveObjectParser.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/24/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_IPRIMITIVEOBJECTPARSER_H
+#define JAVAOBJECTSTREAMS_IPRIMITIVEOBJECTPARSER_H
+#include
+
+namespace javaobject::type::primitive {
+ class PrimitiveTypeCodeParser;
+}
+namespace javaobject::type::primitive::types {
+ struct IPrimitiveObject;
+}
+
+namespace javaobject::type::primitive::parsers {
+ class IPrimitiveObjectParser {
+ public:
+ virtual ~IPrimitiveObjectParser() = default;
+
+ virtual std::shared_ptr operator()(PrimitiveTypeCodeParser &parser) const = 0;
+ };
+} // namespace javaobject::type::primitive::parsers
+
+#endif // JAVAOBJECTSTREAMS_IPRIMITIVEOBJECTPARSER_H
diff --git a/include/JavaObject/type/primitive/parsers/PrimitiveArrayObjectParser.h b/include/JavaObject/type/primitive/parsers/PrimitiveArrayObjectParser.h
new file mode 100644
index 0000000..66b3080
--- /dev/null
+++ b/include/JavaObject/type/primitive/parsers/PrimitiveArrayObjectParser.h
@@ -0,0 +1,23 @@
+/** @file PrimitiveArrayObjectParser.h
+*
+* @author Zero_DSRS_VX
+* @author Dexrn ZacAttack
+*
+* @date 3/25/26
+*
+* @device mac-8
+*
+* @copyright Copyright (c) 2026 Team Lodestone
+* @license This project is licensed under the LGPL 3.0 license, see the LICENSE file for details.
+*/
+#ifndef PROJECTLODESTONE_PRIMITIVEARRAYOBJECTPARSER_H
+#define PROJECTLODESTONE_PRIMITIVEARRAYOBJECTPARSER_H
+#include "IPrimitiveObjectParser.h"
+
+namespace javaobject::type::primitive::parsers {
+ struct PrimitiveArrayObjectParser : IPrimitiveObjectParser {
+ std::shared_ptr operator()(PrimitiveTypeCodeParser& parser) const override;
+ };
+}
+
+#endif //PROJECTLODESTONE_PRIMITIVEARRAYOBJECTPARSER_H
diff --git a/include/JavaObject/type/primitive/parsers/PrimitiveBooleanObjectParser.h b/include/JavaObject/type/primitive/parsers/PrimitiveBooleanObjectParser.h
new file mode 100644
index 0000000..f9c6314
--- /dev/null
+++ b/include/JavaObject/type/primitive/parsers/PrimitiveBooleanObjectParser.h
@@ -0,0 +1,21 @@
+/** @file PrimitiveBooleanObjectParser.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/25/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_PRIMITIVEBOOLEANOBJECTPARSER_H
+#define JAVAOBJECTSTREAMS_PRIMITIVEBOOLEANOBJECTPARSER_H
+#include "JavaObject/type/primitive/parsers/IPrimitiveObjectParser.h"
+
+namespace javaobject::type::primitive::parsers {
+ struct PrimitiveBooleanObjectParser : IPrimitiveObjectParser {
+ std::shared_ptr operator()(PrimitiveTypeCodeParser &parser) const override;
+ };
+} // namespace javaobject::type::primitive::parsers
+
+#endif // JAVAOBJECTSTREAMS_PRIMITIVEBOOLEANOBJECTPARSER_H
diff --git a/include/JavaObject/type/primitive/parsers/PrimitiveByteObjectParser.h b/include/JavaObject/type/primitive/parsers/PrimitiveByteObjectParser.h
new file mode 100644
index 0000000..ce3de22
--- /dev/null
+++ b/include/JavaObject/type/primitive/parsers/PrimitiveByteObjectParser.h
@@ -0,0 +1,21 @@
+/** @file PrimitiveByteObjectParser.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/25/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_PRIMITIVEBYTEOBJECTPARSER_H
+#define JAVAOBJECTSTREAMS_PRIMITIVEBYTEOBJECTPARSER_H
+#include "JavaObject/type/primitive/parsers/IPrimitiveObjectParser.h"
+
+namespace javaobject::type::primitive::parsers {
+ struct PrimitiveByteObjectParser : IPrimitiveObjectParser {
+ std::shared_ptr operator()(PrimitiveTypeCodeParser &parser) const override;
+ };
+} // namespace javaobject::type::primitive::parsers
+
+#endif // JAVAOBJECTSTREAMS_PRIMITIVEBYTEOBJECTPARSER_H
diff --git a/include/JavaObject/type/primitive/parsers/PrimitiveCharObjectParser.h b/include/JavaObject/type/primitive/parsers/PrimitiveCharObjectParser.h
new file mode 100644
index 0000000..69221e5
--- /dev/null
+++ b/include/JavaObject/type/primitive/parsers/PrimitiveCharObjectParser.h
@@ -0,0 +1,21 @@
+/** @file PrimitiveCharObjectParser.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/25/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_PRIMITIVECHAROBJECTPARSER_H
+#define JAVAOBJECTSTREAMS_PRIMITIVECHAROBJECTPARSER_H
+#include "JavaObject/type/primitive/parsers/IPrimitiveObjectParser.h"
+
+namespace javaobject::type::primitive::parsers {
+ struct PrimitiveCharObjectParser : IPrimitiveObjectParser {
+ std::shared_ptr operator()(PrimitiveTypeCodeParser &parser) const override;
+ };
+} // namespace javaobject::type::primitive::parsers
+
+#endif // JAVAOBJECTSTREAMS_PRIMITIVECHAROBJECTPARSER_H
diff --git a/include/JavaObject/type/primitive/parsers/PrimitiveDoubleObjectParser.h b/include/JavaObject/type/primitive/parsers/PrimitiveDoubleObjectParser.h
new file mode 100644
index 0000000..97e505b
--- /dev/null
+++ b/include/JavaObject/type/primitive/parsers/PrimitiveDoubleObjectParser.h
@@ -0,0 +1,21 @@
+/** @file PrimitiveDoubleObjectParser.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/25/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_PRIMITIVEDOUBLEOBJECTPARSER_H
+#define JAVAOBJECTSTREAMS_PRIMITIVEDOUBLEOBJECTPARSER_H
+#include "JavaObject/type/primitive/parsers/IPrimitiveObjectParser.h"
+
+namespace javaobject::type::primitive::parsers {
+ struct PrimitiveDoubleObjectParser : IPrimitiveObjectParser {
+ std::shared_ptr operator()(PrimitiveTypeCodeParser &parser) const override;
+ };
+} // namespace javaobject::type::primitive::parsers
+
+#endif // JAVAOBJECTSTREAMS_PRIMITIVEDOUBLEOBJECTPARSER_H
diff --git a/include/JavaObject/type/primitive/parsers/PrimitiveFloatObjectParser.h b/include/JavaObject/type/primitive/parsers/PrimitiveFloatObjectParser.h
new file mode 100644
index 0000000..0cd2d7b
--- /dev/null
+++ b/include/JavaObject/type/primitive/parsers/PrimitiveFloatObjectParser.h
@@ -0,0 +1,21 @@
+/** @file PrimitiveFloatObjectParser.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/25/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_PRIMITIVEFLOATOBJECTPARSER_H
+#define JAVAOBJECTSTREAMS_PRIMITIVEFLOATOBJECTPARSER_H
+#include "JavaObject/type/primitive/parsers/IPrimitiveObjectParser.h"
+
+namespace javaobject::type::primitive::parsers {
+ struct PrimitiveFloatObjectParser : IPrimitiveObjectParser {
+ std::shared_ptr operator()(PrimitiveTypeCodeParser &parser) const override;
+ };
+} // namespace javaobject::type::primitive::parsers
+
+#endif // JAVAOBJECTSTREAMS_PRIMITIVEFLOATOBJECTPARSER_H
diff --git a/include/JavaObject/type/primitive/parsers/PrimitiveIntegerObjectParser.h b/include/JavaObject/type/primitive/parsers/PrimitiveIntegerObjectParser.h
new file mode 100644
index 0000000..cbb40e3
--- /dev/null
+++ b/include/JavaObject/type/primitive/parsers/PrimitiveIntegerObjectParser.h
@@ -0,0 +1,21 @@
+/** @file PrimitiveIntegerObjectParser.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/25/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_PRIMITIVEINTEGEROBJECTPARSER_H
+#define JAVAOBJECTSTREAMS_PRIMITIVEINTEGEROBJECTPARSER_H
+#include "JavaObject/type/primitive/parsers/IPrimitiveObjectParser.h"
+
+namespace javaobject::type::primitive::parsers {
+ struct PrimitiveIntegerObjectParser : IPrimitiveObjectParser {
+ std::shared_ptr operator()(PrimitiveTypeCodeParser &parser) const override;
+ };
+} // namespace javaobject::type::primitive::parsers
+
+#endif // JAVAOBJECTSTREAMS_PRIMITIVEINTEGEROBJECTPARSER_H
diff --git a/include/JavaObject/type/primitive/parsers/PrimitiveJavaObjectParser.h b/include/JavaObject/type/primitive/parsers/PrimitiveJavaObjectParser.h
new file mode 100644
index 0000000..a53c5fa
--- /dev/null
+++ b/include/JavaObject/type/primitive/parsers/PrimitiveJavaObjectParser.h
@@ -0,0 +1,23 @@
+/** @file PrimitiveJavaObjectParser.h
+*
+* @author Zero_DSRS_VX
+* @author Dexrn ZacAttack
+*
+* @date 3/25/26
+*
+* @device mac-8
+*
+* @copyright Copyright (c) 2026 Team Lodestone
+* @license This project is licensed under the LGPL 3.0 license, see the LICENSE file for details.
+*/
+#ifndef PROJECTLODESTONE_PRIMITIVEJAVAOBJECTPARSER_H
+#define PROJECTLODESTONE_PRIMITIVEJAVAOBJECTPARSER_H
+#include "IPrimitiveObjectParser.h"
+
+namespace javaobject::type::primitive::parsers {
+ struct PrimitiveJavaObjectParser : IPrimitiveObjectParser {
+ std::shared_ptr operator()(PrimitiveTypeCodeParser &parser) const override;
+ };
+}
+
+#endif //PROJECTLODESTONE_PRIMITIVEJAVAOBJECTPARSER_H
diff --git a/include/JavaObject/type/primitive/parsers/PrimitiveLongObjectParser.h b/include/JavaObject/type/primitive/parsers/PrimitiveLongObjectParser.h
new file mode 100644
index 0000000..ca9f173
--- /dev/null
+++ b/include/JavaObject/type/primitive/parsers/PrimitiveLongObjectParser.h
@@ -0,0 +1,21 @@
+/** @file PrimitiveLongObjectParser.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/25/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_PRIMITIVELONGOBJECTPARSER_H
+#define JAVAOBJECTSTREAMS_PRIMITIVELONGOBJECTPARSER_H
+#include "JavaObject/type/primitive/parsers/IPrimitiveObjectParser.h"
+
+namespace javaobject::type::primitive::parsers {
+ struct PrimitiveLongObjectParser : IPrimitiveObjectParser {
+ std::shared_ptr operator()(PrimitiveTypeCodeParser &parser) const override;
+ };
+} // namespace javaobject::type::primitive::parsers
+
+#endif // JAVAOBJECTSTREAMS_PRIMITIVELONGOBJECTPARSER_H
diff --git a/include/JavaObject/type/primitive/parsers/PrimitiveShortObjectParser.h b/include/JavaObject/type/primitive/parsers/PrimitiveShortObjectParser.h
new file mode 100644
index 0000000..2a09a2e
--- /dev/null
+++ b/include/JavaObject/type/primitive/parsers/PrimitiveShortObjectParser.h
@@ -0,0 +1,21 @@
+/** @file PrimitiveShortObjectParser.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/25/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_PRIMITIVESHORTOBJECTPARSER_H
+#define JAVAOBJECTSTREAMS_PRIMITIVESHORTOBJECTPARSER_H
+#include "JavaObject/type/primitive/parsers/IPrimitiveObjectParser.h"
+
+namespace javaobject::type::primitive::parsers {
+ struct PrimitiveShortObjectParser : IPrimitiveObjectParser {
+ std::shared_ptr operator()(PrimitiveTypeCodeParser &parser) const override;
+ };
+} // namespace javaobject::type::primitive::parsers
+
+#endif // JAVAOBJECTSTREAMS_PRIMITIVESHORTOBJECTPARSER_H
diff --git a/include/JavaObject/type/primitive/types/IPrimitiveObject.h b/include/JavaObject/type/primitive/types/IPrimitiveObject.h
new file mode 100644
index 0000000..e72a6ab
--- /dev/null
+++ b/include/JavaObject/type/primitive/types/IPrimitiveObject.h
@@ -0,0 +1,42 @@
+/** @file IPrimitiveObject.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/24/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_IPRIMITIVEOBJECT_H
+#define JAVAOBJECTSTREAMS_IPRIMITIVEOBJECT_H
+#include "JavaObject/EPrimitiveTypeCode.h"
+
+#include
+
+namespace javaobject::type::primitive::types {
+ struct IPrimitiveObject {
+ virtual ~IPrimitiveObject() = default;
+
+ virtual EPrimitiveTypeCode typeCode() = 0;
+
+ template
+ requires std::is_base_of_v
+ T *as() {
+ return dynamic_cast(this);
+ }
+ };
+
+ template
+ struct IPrimitiveTypeObject : IPrimitiveObject {
+ explicit IPrimitiveTypeObject(T value) : value(value) {}
+
+ operator T() {
+ return value;
+ }
+
+ T value;
+ };
+} // namespace javaobject::type::primitive::types
+
+#endif // JAVAOBJECTSTREAMS_IPRIMITIVEOBJECT_H
diff --git a/include/JavaObject/type/primitive/types/PrimitiveArrayObject.h b/include/JavaObject/type/primitive/types/PrimitiveArrayObject.h
new file mode 100644
index 0000000..4b1ab68
--- /dev/null
+++ b/include/JavaObject/type/primitive/types/PrimitiveArrayObject.h
@@ -0,0 +1,21 @@
+/** @file PrimitiveArrayObject.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/25/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_PRIMITIVEARRAYOBJECT_H
+#define JAVAOBJECTSTREAMS_PRIMITIVEARRAYOBJECT_H
+#include "JavaObject/type/primitive/types/IPrimitiveObject.h"
+
+namespace javaobject::type::primitive::types {
+ struct PrimitiveArrayObject : IPrimitiveObject {
+ EPrimitiveTypeCode typeCode() override;
+ };
+} // namespace javaobject::type::primitive::types
+
+#endif // JAVAOBJECTSTREAMS_PRIMITIVEARRAYOBJECT_H
diff --git a/include/JavaObject/type/primitive/types/PrimitiveBooleanObject.h b/include/JavaObject/type/primitive/types/PrimitiveBooleanObject.h
new file mode 100644
index 0000000..d197595
--- /dev/null
+++ b/include/JavaObject/type/primitive/types/PrimitiveBooleanObject.h
@@ -0,0 +1,23 @@
+/** @file PrimitiveBooleanObject.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/25/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_PRIMITIVEBOOLEANOBJECT_H
+#define JAVAOBJECTSTREAMS_PRIMITIVEBOOLEANOBJECT_H
+#include "JavaObject/type/primitive/types/IPrimitiveObject.h"
+
+namespace javaobject::type::primitive::types {
+ struct PrimitiveBooleanObject : IPrimitiveTypeObject {
+ explicit PrimitiveBooleanObject(const bool b) : IPrimitiveTypeObject(b) {}
+
+ EPrimitiveTypeCode typeCode() override;
+ };
+} // namespace javaobject::type::primitive::types
+
+#endif // JAVAOBJECTSTREAMS_PRIMITIVEBOOLEANOBJECT_H
diff --git a/include/JavaObject/type/primitive/types/PrimitiveByteObject.h b/include/JavaObject/type/primitive/types/PrimitiveByteObject.h
new file mode 100644
index 0000000..e1912a9
--- /dev/null
+++ b/include/JavaObject/type/primitive/types/PrimitiveByteObject.h
@@ -0,0 +1,25 @@
+/** @file PrimitiveByteObject.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/25/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_PRIMITIVEBYTEOBJECT_H
+#define JAVAOBJECTSTREAMS_PRIMITIVEBYTEOBJECT_H
+#include "JavaObject/type/primitive/types/IPrimitiveObject.h"
+
+#include
+
+namespace javaobject::type::primitive::types {
+ struct PrimitiveByteObject : IPrimitiveTypeObject {
+ explicit PrimitiveByteObject(const std::int8_t byte) : IPrimitiveTypeObject(byte) {}
+
+ EPrimitiveTypeCode typeCode() override;
+ };
+} // namespace javaobject::type::primitive::types
+
+#endif // JAVAOBJECTSTREAMS_PRIMITIVEBYTEOBJECT_H
diff --git a/include/JavaObject/type/primitive/types/PrimitiveCharObject.h b/include/JavaObject/type/primitive/types/PrimitiveCharObject.h
new file mode 100644
index 0000000..a2b679b
--- /dev/null
+++ b/include/JavaObject/type/primitive/types/PrimitiveCharObject.h
@@ -0,0 +1,25 @@
+/** @file PrimitiveCharObject.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/25/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_PRIMITIVECHAROBJECT_H
+#define JAVAOBJECTSTREAMS_PRIMITIVECHAROBJECT_H
+#include "JavaObject/type/primitive/types/IPrimitiveObject.h"
+
+namespace javaobject::type::primitive::types {
+
+ struct PrimitiveCharObject : IPrimitiveTypeObject {
+ explicit PrimitiveCharObject(const char16_t ch) : IPrimitiveTypeObject(ch) {}
+
+ EPrimitiveTypeCode typeCode() override;
+ };
+
+} // namespace javaobject::type::primitive::types
+
+#endif // JAVAOBJECTSTREAMS_PRIMITIVECHAROBJECT_H
diff --git a/include/JavaObject/type/primitive/types/PrimitiveDoubleObject.h b/include/JavaObject/type/primitive/types/PrimitiveDoubleObject.h
new file mode 100644
index 0000000..84952de
--- /dev/null
+++ b/include/JavaObject/type/primitive/types/PrimitiveDoubleObject.h
@@ -0,0 +1,23 @@
+/** @file PrimitiveDoubleObject.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/25/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_PRIMITIVEDOUBLEOBJECT_H
+#define JAVAOBJECTSTREAMS_PRIMITIVEDOUBLEOBJECT_H
+#include "JavaObject/type/primitive/types/IPrimitiveObject.h"
+
+namespace javaobject::type::primitive::types {
+ struct PrimitiveDoubleObject : IPrimitiveTypeObject {
+ explicit PrimitiveDoubleObject(const double d) : IPrimitiveTypeObject(d) {}
+
+ EPrimitiveTypeCode typeCode() override;
+ };
+} // namespace javaobject::type::primitive::types
+
+#endif // JAVAOBJECTSTREAMS_PRIMITIVEDOUBLEOBJECT_H
diff --git a/include/JavaObject/type/primitive/types/PrimitiveFloatObject.h b/include/JavaObject/type/primitive/types/PrimitiveFloatObject.h
new file mode 100644
index 0000000..fa41abd
--- /dev/null
+++ b/include/JavaObject/type/primitive/types/PrimitiveFloatObject.h
@@ -0,0 +1,23 @@
+/** @file PrimitiveFloatObject.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/25/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_PRIMITIVEFLOATOBJECT_H
+#define JAVAOBJECTSTREAMS_PRIMITIVEFLOATOBJECT_H
+#include "JavaObject/type/primitive/types/IPrimitiveObject.h"
+
+namespace javaobject::type::primitive::types {
+ struct PrimitiveFloatObject : IPrimitiveTypeObject {
+ explicit PrimitiveFloatObject(const float f) : IPrimitiveTypeObject(f) {}
+
+ EPrimitiveTypeCode typeCode() override;
+ };
+} // namespace javaobject::type::primitive::types
+
+#endif // JAVAOBJECTSTREAMS_PRIMITIVEFLOATOBJECT_H
diff --git a/include/JavaObject/type/primitive/types/PrimitiveIntegerObject.h b/include/JavaObject/type/primitive/types/PrimitiveIntegerObject.h
new file mode 100644
index 0000000..c34eb4c
--- /dev/null
+++ b/include/JavaObject/type/primitive/types/PrimitiveIntegerObject.h
@@ -0,0 +1,25 @@
+/** @file PrimitiveIntegerObject.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/25/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_PRIMITIVEINTEGEROBJECT_H
+#define JAVAOBJECTSTREAMS_PRIMITIVEINTEGEROBJECT_H
+#include "JavaObject/type/primitive/types/IPrimitiveObject.h"
+
+#include
+
+namespace javaobject::type::primitive::types {
+ struct PrimitiveIntegerObject : IPrimitiveTypeObject {
+ explicit PrimitiveIntegerObject(const std::int32_t i) : IPrimitiveTypeObject(i) {}
+
+ EPrimitiveTypeCode typeCode() override;
+ };
+} // namespace javaobject::type::primitive::types
+
+#endif // JAVAOBJECTSTREAMS_PRIMITIVEINTEGEROBJECT_H
diff --git a/include/JavaObject/type/primitive/types/PrimitiveJavaObject.h b/include/JavaObject/type/primitive/types/PrimitiveJavaObject.h
new file mode 100644
index 0000000..facf5b1
--- /dev/null
+++ b/include/JavaObject/type/primitive/types/PrimitiveJavaObject.h
@@ -0,0 +1,25 @@
+/** @file PrimitiveJavaObject.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/25/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_PRIMITIVEJAVAOBJECT_H
+#define JAVAOBJECTSTREAMS_PRIMITIVEJAVAOBJECT_H
+#include "JavaObject/type/object/types/IObject.h"
+#include "JavaObject/type/primitive/types/IPrimitiveObject.h"
+#include
+
+namespace javaobject::type::primitive::types {
+ struct PrimitiveJavaObject : IPrimitiveTypeObject> {
+ explicit PrimitiveJavaObject(const std::shared_ptr &obj) : IPrimitiveTypeObject(obj) {}
+
+ EPrimitiveTypeCode typeCode() override;
+ };
+} // namespace javaobject::type::primitive::types
+
+#endif // JAVAOBJECTSTREAMS_PRIMITIVEJAVAOBJECT_H
diff --git a/include/JavaObject/type/primitive/types/PrimitiveLongObject.h b/include/JavaObject/type/primitive/types/PrimitiveLongObject.h
new file mode 100644
index 0000000..0bf2c79
--- /dev/null
+++ b/include/JavaObject/type/primitive/types/PrimitiveLongObject.h
@@ -0,0 +1,25 @@
+/** @file PrimitiveLongObject.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/25/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_PRIMITIVELONGOBJECT_H
+#define JAVAOBJECTSTREAMS_PRIMITIVELONGOBJECT_H
+#include "JavaObject/type/primitive/types/IPrimitiveObject.h"
+
+#include
+
+namespace javaobject::type::primitive::types {
+ struct PrimitiveLongObject : IPrimitiveTypeObject {
+ explicit PrimitiveLongObject(const std::int64_t l) : IPrimitiveTypeObject(l) {}
+
+ EPrimitiveTypeCode typeCode() override;
+ };
+} // namespace javaobject::type::primitive::types
+
+#endif // JAVAOBJECTSTREAMS_PRIMITIVELONGOBJECT_H
diff --git a/include/JavaObject/type/primitive/types/PrimitiveShortObject.h b/include/JavaObject/type/primitive/types/PrimitiveShortObject.h
new file mode 100644
index 0000000..686ba97
--- /dev/null
+++ b/include/JavaObject/type/primitive/types/PrimitiveShortObject.h
@@ -0,0 +1,25 @@
+/** @file PrimitiveShortObject.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/25/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_PRIMITIVESHORTOBJECT_H
+#define JAVAOBJECTSTREAMS_PRIMITIVESHORTOBJECT_H
+#include "JavaObject/type/primitive/types/IPrimitiveObject.h"
+
+#include
+
+namespace javaobject::type::primitive::types {
+ struct PrimitiveShortObject : IPrimitiveTypeObject {
+ explicit PrimitiveShortObject(const std::int16_t s) : IPrimitiveTypeObject(s) {}
+
+ EPrimitiveTypeCode typeCode() override;
+ };
+} // namespace javaobject::type::primitive::types
+
+#endif // JAVAOBJECTSTREAMS_PRIMITIVESHORTOBJECT_H
diff --git a/include/JavaObject/util/SmartPointerCast.h b/include/JavaObject/util/SmartPointerCast.h
new file mode 100644
index 0000000..615ec0c
--- /dev/null
+++ b/include/JavaObject/util/SmartPointerCast.h
@@ -0,0 +1,27 @@
+/** @file UniquePtrCast.h
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/24/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file
+ * for details.
+ */
+#ifndef JAVAOBJECTSTREAMS_UNIQUEPTRCAST_H
+#define JAVAOBJECTSTREAMS_UNIQUEPTRCAST_H
+#include
+
+namespace javaobject::util {
+ class SmartPointerCast {
+ public:
+ template static std::unique_ptr staticUniquePtrCast(std::unique_ptr ptr) {
+ To *p = static_cast(ptr.release());
+
+ return std::unique_ptr(p);
+ }
+ };
+} // namespace javaobject::util
+
+#endif // JAVAOBJECTSTREAMS_UNIQUEPTRCAST_H
diff --git a/src/JavaSerializedClassParser.cpp b/src/JavaSerializedClassParser.cpp
deleted file mode 100644
index c291f0d..0000000
--- a/src/JavaSerializedClassParser.cpp
+++ /dev/null
@@ -1,244 +0,0 @@
-/** @file JavaSerializedClassParser.cpp
-*
-* @author Zero_DSRS_VX
-* @date 3/22/26
-*
-* @device mac-8
-*
-* @copyright Copyright (c) 2026 Team Lodestone
-* @license This project is licensed under the MIT license, see the LICENSE file for details.
-*/
-
-#include "JavaObject/JavaSerializedClassParser.h"
-#include "BinaryIO/stream/BinaryInputStream.h"
-#include "JavaObject/EJavaFieldDescriptorType.h"
-
-namespace javaobject {
- SerializedField
- SerializedField::parseFieldEntry(const SerializedClass &clazz,
- bio::stream::BinaryInputStream &strm) {
- // Parse field entry
- const EJavaFieldDescriptorType type = strm.read<
- EJavaFieldDescriptorType>();
- auto descriptor = std::string(1, type);
-
- const std::string name = strm.readStringWithLength(
- bio::util::ByteOrder::BIG,
- bio::util::string::StringLengthEncoding::LENGTH_PREFIX);
-
- // Check if descriptor is object or array
- if (type == TYPE_OBJECT || type == TYPE_ARRAY) {
- descriptor = parseSignature(clazz, type, strm);
- }
- return SerializedField{clazz, name, type, descriptor};
- }
-
- std::string SerializedField::parseSignature(const SerializedClass &clazz,
- const char type,
- bio::stream::BinaryInputStream &
- strm) {
- // TODO separate type from descriptor, we should then store some tree of types ig?
- // we'll see.
- auto descriptor = std::string(1, type);
-
- // Check if descriptor is object or array
- if (type == TYPE_OBJECT || type == TYPE_ARRAY) {
- if (const char typeCode = strm.readByte(); typeCode == TYPE_ARRAY) {
- // Read primitive array
- if (const char arrayType = strm.readByte(); arrayType != TYPE_OBJECT) {
- descriptor += arrayType;
- } else {
- descriptor += parseSignature(clazz, arrayType, strm);
- }
- } else if (typeCode == 't') {
- descriptor = strm.readStringWithLength(
- bio::util::ByteOrder::BIG,
- bio::util::string::StringLengthEncoding::LENGTH_PREFIX);
- } else if (typeCode == 'q') {
- // Type is the same as the field before this one
- if (!clazz.m_fields.empty()) {
- descriptor = clazz.m_fields.back().desc;
-
- // skip a few bytes
- // TODO: Figure out if this means anything
- for (int i = 0; i < 4; i++) {
- strm.readByte();
- }
- }
- } else {
- // LOG_DEBUG("Unrecognized type code!");
- }
- }
- return descriptor;
- }
-
- JavaValue SerializedField::readFieldValue(JavaSerializedClassParser &parser,
- SerializedField &field,
- bio::stream::BinaryInputStream &
- strm) {
- const auto descriptor = field.desc;
- if (field.type == TYPE_BYTE) {
- return JavaValue{strm.readSignedByte()};
- }
- if (field.type == TYPE_BOOLEAN) {
- return JavaValue{(strm.readByte() != 0)};
- }
- if (field.type == TYPE_CHARACTER) {
- return JavaValue{static_cast(strm.readByte())};
- }
- if (field.type == TYPE_DOUBLE) {
- return JavaValue{strm.readBE()};
- }
- if (field.type == TYPE_FLOAT) {
- return JavaValue{strm.readBE()};
- }
- if (field.type == TYPE_INT) {
- // Java always stores integers as signed
- // C++ uses two's-complements when reading the integer in
- // which means we need to shift this down to get the
- // correct sign and value.
- return JavaValue
- {static_cast(strm.readBE() >> 8)};
- }
- if (field.type == TYPE_LONG) {
- return JavaValue
- {static_cast(strm.readBE() >> 8)};
- }
- if (field.type == TYPE_OBJECT) {
- if (descriptor == "Ljava/lang/String;") {
- return JavaValue{
- std::string(strm.readStringWithLength(
- bio::util::ByteOrder::BIG,
- bio::util::string::StringLengthEncoding::LENGTH_PREFIX))
- };
- }
- strm.seekRelative(-1);
-
- // Parse object
- SerializedClass clazz = parser.parseEntry();
- return JavaValue{std::make_shared(clazz)};
- }
- if (field.type == TYPE_ARRAY) {
- // Read TCBlockData as a Java Array is an Object (Block-Like)
- strm.seekRelative(1);
- auto desc = strm.readStringWithLength(bio::util::ByteOrder::BIG,
- bio::util::string::StringLengthEncoding::LENGTH_PREFIX);
-
- JavaArray result;
- auto modifiedDesc = std::string(desc);
- if (modifiedDesc.starts_with("[")) {
- modifiedDesc = modifiedDesc.substr(1);
- }
- std::ranges::replace(modifiedDesc, '.', '/');
- auto originalType = field.type;
- auto modifiedType = static_cast(modifiedDesc[0]);
-
- const int64_t uuid = strm.readBE();
- int padding = strm.readSignedByte();
- strm.seekRelative(padding);
-
- if (const uint16_t tcBlockData = strm.readBE(); tcBlockData != 0x7870) {
- // LOG_ERROR("TCBlockData could not be found after array value was defined.");
- std::cout << tcBlockData << std::endl;
- }
- int32_t fieldCount = strm.readBE();
-
- field.setDescriptor(modifiedDesc);
- field.type = modifiedType;
- strm.seekRelative(1);
- for (int i = 0; i < fieldCount; i++) {
- int offset = strm.getOffset();
- JavaValue value = readFieldValue(parser, field, strm);
- offset = strm.getOffset();
- result.push_back(value);
- strm.seekRelative(1);
- }
- field.setDescriptor(desc);
- field.type = originalType;
-
- return result;
- }
-
- // LOG_DEBUG("Descriptor not yet implemented!");
- return {};
- }
-
- void SerializedField::setDescriptor(const std::string &desc) {
- this->desc = desc;
- }
-
- std::vector JavaSerializedClassParser::parseAllEntries() {
- std::vector result;
- if (!this->m_stream.getStream().eof()) {
- SerializedClass clazz = this->parseEntry();
- }
-
- return result;
- }
-
- SerializedClass JavaSerializedClassParser::parseEntry() {
- SerializedClass result;
-
- if (const uint16_t classMagic = this->m_stream.readBE();
- classMagic != 0x7372) {
- return result;
- }
-
- // Read class name
- result.m_className = this->m_stream.readStringWithLength(
- bio::util::ByteOrder::BIG,
- bio::util::string::StringLengthEncoding::LENGTH_PREFIX);
- this->m_stream.seekRelative(8);
-
- // TODO: Read fields from serialized class object
- this->m_stream.seekRelative(2); // TODO: Look at this more
-
- const int8_t numberOfFields = this->m_stream.readSignedByte();
-
- result.m_fields.clear();
-
- for (int i = 0; i < numberOfFields; i++) {
- SerializedField field = SerializedField::parseFieldEntry(
- result, this->m_stream);
- result.m_fields.push_back(field);
- }
-
- char tcEndBlockData = this->m_stream.readByte();
- if (tcEndBlockData != 0x78) {
- // LOG_ERROR(
- // "TCEndBlockData was not found after reading fields! Stream is either corrupted or signature parsing failed!");
- }
- char tcSuperclassDesc = this->m_stream.readByte();
- if (tcSuperclassDesc == 0x72) {
- // Superclass was specified
- // TODO: Implement reading of superclass
-
- tcEndBlockData = this->m_stream.readByte();
- if (tcEndBlockData != 0x78) {
- // LOG_ERROR(
- // "TCEndBlockData was not found after reading superclass! Stream is either corrupted or superclass could not be parsed!");
- }
-
- // TODO: Remove this hack:
- // This will skip over the superclass declaration if it exists
- while (true) {
- if (this->m_stream.readByte() == 0x78) {
- break;
- }
- }
- } else if (tcSuperclassDesc == 0x70) {
- // Superclass was null
- }
- // Skip one byte
- this->m_stream.seekRelative(1);
-
- // Read field values
- for (int i = 0; i < numberOfFields; i++) {
- SerializedField &field = result.m_fields[i];
- field.value = field.readFieldValue(*this, field, this->m_stream);
- }
-
- this->m_serializedClasses.push_back(result);
- return result;
- }
-} // lodestone::minecraft::common::java::classic::minev3
diff --git a/src/stream/ObjectInputStream.cpp b/src/stream/ObjectInputStream.cpp
index caaa61f..ae7b371 100644
--- a/src/stream/ObjectInputStream.cpp
+++ b/src/stream/ObjectInputStream.cpp
@@ -10,7 +10,29 @@
*/
#include "JavaObject/stream/ObjectInputStream.h"
+#include "JavaObject/type/object/types/NullObject.h"
+#include "JavaObject/type/primitive/PrimitiveTypeCodeParser.h"
+
namespace javaobject::stream {
- ObjectInputStream::ObjectInputStream(std::istream &input) : m_input(input) {
+ ObjectInputStream::ObjectInputStream(std::istream &input) : m_handleContainer(), m_input(input), m_stream(input) {
+ this->m_parsers.objectParser = std::make_shared(input, m_handleContainer, m_parsers);
+ this->m_parsers.primitiveParser = std::make_shared(input, m_handleContainer, m_parsers);
+ }
+
+ std::shared_ptr ObjectInputStream::readObject() {
+ const uint16_t magic = this->m_stream.readBE();
+ if (magic != 0xACED) {
+ return std::make_shared();
+ }
+
+ int16_t count = this->m_stream.readBE();
+
+ return this->m_parsers.objectParser->readNext();
+ }
+
+ ObjectInputStream &ObjectInputStream::operator>>(std::shared_ptr &object) {
+ object = this->readObject();
+
+ return *this;
}
-}
+} // namespace javaobject::stream
\ No newline at end of file
diff --git a/src/type/HandleContainer.cpp b/src/type/HandleContainer.cpp
new file mode 100644
index 0000000..c1bac9c
--- /dev/null
+++ b/src/type/HandleContainer.cpp
@@ -0,0 +1,41 @@
+/** @file HandleContainer.cpp
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/24/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#include "JavaObject/type/HandleContainer.h"
+
+#include
+#include
+
+namespace javaobject::type {
+ void HandleContainer::registerHandle(const std::shared_ptr &object) {
+ this->m_handles.emplace(m_nextHandle, object);
+ std::cout << std::format("new handle at {:#05x}: {}", m_nextHandle, object->toString()) << std::endl;
+
+ this->m_nextHandle++;
+ }
+
+ std::shared_ptr HandleContainer::resolveHandle(const object::ReferenceObject::handle_t handle) {
+ if (const auto it = m_handles.find(handle); it != this->m_handles.end()) {
+ std::cout << std::format("resolved handle at {:#05x}: {}", m_nextHandle, it->second->toString()) << std::endl;
+ return it->second;
+ }
+
+ static_assert("We should never be missing a handle!!!!");
+ return nullptr;
+ }
+
+ std::shared_ptr HandleContainer::resolveReference(const object::ReferenceObject *reference) {
+ return this->resolveHandle(reference->handle);
+ }
+
+ std::shared_ptr HandleContainer::resolveReference(const std::shared_ptr &reference) {
+ return this->resolveReference(reference.get());
+ }
+}
\ No newline at end of file
diff --git a/src/type/ITypeCodeParser.cpp b/src/type/ITypeCodeParser.cpp
new file mode 100644
index 0000000..9e83cc4
--- /dev/null
+++ b/src/type/ITypeCodeParser.cpp
@@ -0,0 +1,15 @@
+/** @file ITypeCodeParser.cpp
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/24/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#include "JavaObject/type/ITypeCodeParser.h"
+
+namespace javaobject {
+ namespace type {} // namespace type
+} // namespace javaobject
\ No newline at end of file
diff --git a/src/type/ITypeCodeStorageHolder.cpp b/src/type/ITypeCodeStorageHolder.cpp
new file mode 100644
index 0000000..5acd936
--- /dev/null
+++ b/src/type/ITypeCodeStorageHolder.cpp
@@ -0,0 +1,19 @@
+/** @file ITypeCodeStorageHolder.cpp
+*
+* @author Zero_DSRS_VX
+* @date 3/25/26
+*
+* @device mac-8
+*
+* @copyright Copyright (c) 2026 Team Lodestone
+* @license This project is licensed under the LGPL 3.0 license, see the LICENSE file for details.
+*/
+#include "JavaObject/type/ITypeCodeStorageHolder.h"
+
+namespace javaobject::type {
+ ITypeCodeStorageHolder::ITypeCodeStorageHolder(TypeCodeParserStorage &parserStorage) : m_parserStorage(parserStorage) {}
+
+ TypeCodeParserStorage &ITypeCodeStorageHolder::parserStorage() {
+ return this->m_parserStorage;
+ }
+} // javaobject::type
\ No newline at end of file
diff --git a/src/type/TypeCodeParserStorage.cpp b/src/type/TypeCodeParserStorage.cpp
new file mode 100644
index 0000000..b2dd468
--- /dev/null
+++ b/src/type/TypeCodeParserStorage.cpp
@@ -0,0 +1,15 @@
+/** @file TypeCodeParserStorage.cpp
+*
+* @author Zero_DSRS_VX
+* @date 3/25/26
+*
+* @device mac-8
+*
+* @copyright Copyright (c) 2026 Team Lodestone
+* @license This project is licensed under the LGPL 3.0 license, see the LICENSE file for details.
+*/
+#include "JavaObject/type/TypeCodeParserStorage.h"
+
+namespace javaobject::type {
+
+} // javaobject::type
\ No newline at end of file
diff --git a/src/type/object/ObjectTypeCodeParser.cpp b/src/type/object/ObjectTypeCodeParser.cpp
new file mode 100644
index 0000000..34d2ca6
--- /dev/null
+++ b/src/type/object/ObjectTypeCodeParser.cpp
@@ -0,0 +1,64 @@
+/** @file TypeCode.cpp
+ *
+ * @author DexrnZacAttack
+ * @date 3/24/26
+ *
+ * @device zPc-i2
+ */
+#include "JavaObject/type/object/ObjectTypeCodeParser.h"
+
+#include "JavaObject/type/object/parsers/ArrayObjectParser.h"
+
+#include
+#include
+
+#include "JavaObject/type/primitive/PrimitiveTypeCodeParser.h"
+
+#include "JavaObject/type/object/types/NullObject.h"
+#include "JavaObject/type/object/parsers/ObjectParser.h"
+#include "JavaObject/type/object/parsers/ReferenceParser.h"
+#include "JavaObject/type/object/parsers/StringParser.h"
+#include "JavaObject/type/object/parsers/descriptor/NewClassDescriptorParser.h"
+
+#include
+
+#include "JavaObject/type/object/parsers/EndBlockDataObjectParser.h"
+#include "JavaObject/type/object/parsers/LongBlockDataObjectParser.h"
+#include "JavaObject/type/object/parsers/NullObjectParser.h"
+#include "JavaObject/type/object/parsers/ShortBlockDataObjectParser.h"
+
+namespace javaobject::type::object {
+ ObjectTypeCodeParser::ObjectTypeCodeParser(std::istream &input, HandleContainer &handleContainer, TypeCodeParserStorage &parserStorage) : ITypeCodeParser(input, handleContainer), ITypeCodeStorageHolder(parserStorage) {
+ this->m_parsers[EObjectTypeCode::TC_STRING] = std::make_unique();
+ this->m_parsers[EObjectTypeCode::TC_OBJECT] = std::make_unique();
+ this->m_parsers[EObjectTypeCode::TC_CLASSDESC] = std::make_unique();
+ this->m_parsers[EObjectTypeCode::TC_REFERENCE] = std::make_unique();
+ this->m_parsers[EObjectTypeCode::TC_ENDBLOCKDATA] = std::make_unique();
+ this->m_parsers[EObjectTypeCode::TC_BLOCKDATA] = std::make_unique();
+ this->m_parsers[EObjectTypeCode::TC_BLOCKDATALONG] = std::make_unique();
+ this->m_parsers[EObjectTypeCode::TC_NULL] = std::make_unique();
+ this->m_parsers[EObjectTypeCode::TC_ARRAY] = std::make_unique();
+ }
+
+ std::shared_ptr ObjectTypeCodeParser::readNext() {
+ const EObjectTypeCode tc = static_cast(this->m_input.readByte());
+
+ std::cout << "tc: " << static_cast(tc) << std::endl;
+ std::cout << "pos: " << this->m_input.getOffset() << std::endl;
+
+ if (const auto it = m_parsers.find(tc); it != this->m_parsers.end()) {
+ return this->readUsingParser(*it->second);
+ }
+
+ if (tc < EObjectTypeCode::TC_BASE || tc > EObjectTypeCode::TC_MAX) {
+ throw std::runtime_error(std::format("typecode {} is out of range!!!", static_cast(tc)));
+ }
+
+ throw std::runtime_error(std::format("invalid typecode {}", static_cast(tc)));
+ return std::make_shared();
+ }
+
+ std::shared_ptr ObjectTypeCodeParser::readUsingParser(const object::parsers::IObjectParser &parser) {
+ return parser(*this);
+ }
+} // namespace javaobject::type
\ No newline at end of file
diff --git a/src/type/object/parsers/ArrayObjectParser.cpp b/src/type/object/parsers/ArrayObjectParser.cpp
new file mode 100644
index 0000000..e1137b8
--- /dev/null
+++ b/src/type/object/parsers/ArrayObjectParser.cpp
@@ -0,0 +1,40 @@
+/** @file ArrayObjectParser.cpp
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/25/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#include "JavaObject/type/object/parsers/ArrayObjectParser.h"
+
+#include "JavaObject/type/object/types/ArrayObject.h"
+
+#include "JavaObject/type/object/ObjectTypeCodeParser.h"
+#include "JavaObject/type/primitive/PrimitiveTypeCodeParser.h"
+
+namespace javaobject::type::object::parsers {
+ std::shared_ptr ArrayObjectParser::operator()(type::object::ObjectTypeCodeParser &parser) const {
+ auto dc = std::dynamic_pointer_cast(parser.readNext());
+
+ if (!dc) {
+ throw std::runtime_error("Array type descriptor is TC_NULL!!!!!");
+ }
+
+ auto obj = std::make_shared(dc);
+ parser.handleContainer().registerHandle(obj);
+
+ const int32_t size = parser.stream().readBE();
+ obj->values.resize(size);
+
+ const auto primitiveParser = parser.parserStorage().primitiveParser;
+ const auto parserClass = primitiveParser->getParser(static_cast(dc->name.at(1)));
+ for (int32_t i = 0; i < size; i++) {
+ obj->values[i] = primitiveParser->readUsingParser(*parserClass);
+ }
+
+ return obj;
+ }
+} // namespace javaobject::type::object::parsers
\ No newline at end of file
diff --git a/src/type/object/parsers/ClassDataParser.cpp b/src/type/object/parsers/ClassDataParser.cpp
new file mode 100644
index 0000000..20d8acd
--- /dev/null
+++ b/src/type/object/parsers/ClassDataParser.cpp
@@ -0,0 +1,110 @@
+/** @file ClassDataParser.cpp
+ *
+ * @author Dexrn ZacAttack
+ * @date 3/24/26
+ *
+ * @device zPc-i2
+ *
+ * @copyright Copyright (c) 2026 Team Lodestone
+ * @license This project is licensed under the MIT license, see the LICENSE file for details.
+ */
+#include "JavaObject/type/object/parsers/ClassDataParser.h"
+
+#include "JavaObject/type/object/ObjectTypeCodeParser.h"
+#include "JavaObject/type/object/types/NullObject.h"
+#include "JavaObject/type/object/types/descriptor/ClassDescriptorInfoObject.h"
+
+#include
+
+#include "JavaObject/type/object/types/AnnotationObject.h"
+#include "JavaObject/type/object/types/EndBlockDataObject.h"
+#include "JavaObject/type/object/types/descriptor/NewClassDescriptorObject.h"
+#include "JavaObject/type/primitive/PrimitiveTypeCodeParser.h"
+
+#include
+
+namespace javaobject::type::object::parsers {
+ ClassDataParser::ClassDataParser(const std::shared_ptr &classDescInfo) : m_classDescInfo(classDescInfo) {
+ // this->m_parsers = {{
+ //
+ // }};
+ }
+
+ std::shared_ptr ClassDataParser::operator()(type::object::ObjectTypeCodeParser &parser) const {
+ if (this->m_classDescInfo->flags & object::descriptor::ClassDescriptorInfoObject::Flags::SC_SERIALIZABLE) {
+ if (this->m_classDescInfo->flags & object::descriptor::ClassDescriptorInfoObject::Flags::SC_WRITE_METHOD) {
+ return parseSerializableWriteMethodClassData(parser);
+ }
+ return parseSerializableClassData(parser);
+ }
+
+ if (this->m_classDescInfo->flags & object::descriptor::ClassDescriptorInfoObject::Flags::SC_EXTERNALIZABLE) {
+ if (this->m_classDescInfo->flags & object::descriptor::ClassDescriptorInfoObject::Flags::SC_BLOCK_DATA) {
+ return parseExternalizableBlockDataClassData(parser);
+ }
+
+ return parseExternalizableClassData(parser);
+ }
+
+ assert("We're reading classdata, but the result would be null?");
+ return std::make_unique();
+ }
+
+ std::shared_ptr ClassDataParser::parseSerializableClassData(type::object::ObjectTypeCodeParser &parser) const {
+ auto d = std::make_shared();
+
+ auto primitiveParser = parser.parserStorage().primitiveParser;
+
+ std::deque> tree;
+
+ std::shared_ptr super = this->m_classDescInfo;
+ while (typeid(*super) != typeid(NullObject)) {
+ auto sp = std::static_pointer_cast(super);
+ tree.push_front(sp);
+
+ auto nsp = std::dynamic_pointer_cast