# raredeveloperofficials/bam architecture

> Architecture diagram of the GitHub repository raredeveloperofficials/bam, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/raredeveloperofficials/bam
- Repository: https://github.com/raredeveloperofficials/bam

## Overview

BAM is a Godot binary-serialization library with a separate Java implementation. Its principal workflow converts a Godot Dictionary into BAMData, serializes it to bytes, then deserializes those bytes and restores a Dictionary. The README also documents pooled strings and numbers, nested data, key lookup, byte-array utilities, and global access. Source excerpts are limited to part of the Java implementation, so Godot-side relationships below rely on the README rather than inspected GDScript calls.

Main entry points: [`GD/bam.gd`](https://github.com/raredeveloperofficials/bam/blob/main/GD/bam.gd) (BAMData), [`GD/plugin.gd`](https://github.com/raredeveloperofficials/bam/blob/main/GD/plugin.gd) (Plugin access), [`JAVA/BAM.java`](https://github.com/raredeveloperofficials/bam/blob/main/JAVA/BAM.java) (Java implementation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_godot["Godot serialization"]
  node_plugin["Plugin access<br/>[plugin.gd]"]
  node_map_encode["Map conversion<br/>[bam.gd]"]
  node_bamdata["BAMData<br/>[bam.gd]"]
  node_lookup["Key lookup<br/>[bam.gd]"]
  node_byte_utils["Byte utilities<br/>[bam.gd]"]
end

subgraph group_binary["Binary format"]
  node_java_impl["Java implementation<br/>[BAM.java]"]
end

node_user(("Godot application"))

node_user -->|"enables"| node_plugin
node_plugin -->|"exposes"| node_map_encode
node_user -->|"converts map"| node_map_encode
node_map_encode -->|"creates"| node_bamdata
node_bamdata -->|"serializes bytes"| node_bamdata
node_bamdata -->|"deserializes bytes"| node_bamdata
node_bamdata -->|"restores map"| node_map_encode
node_user -->|"looks up key"| node_lookup
node_lookup -->|"reads value"| node_bamdata
node_user -->|"wraps or extracts"| node_byte_utils
node_java_impl -.->|"shares format"| node_bamdata

click node_plugin "https://github.com/raredeveloperofficials/bam/blob/main/GD/plugin.gd"
click node_map_encode "https://github.com/raredeveloperofficials/bam/blob/main/GD/bam.gd"
click node_bamdata "https://github.com/raredeveloperofficials/bam/blob/main/GD/bam.gd"
click node_lookup "https://github.com/raredeveloperofficials/bam/blob/main/GD/bam.gd"
click node_byte_utils "https://github.com/raredeveloperofficials/bam/blob/main/GD/bam.gd"
click node_java_impl "https://github.com/raredeveloperofficials/bam/blob/main/JAVA/BAM.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_plugin,node_map_encode,node_bamdata,node_lookup,node_byte_utils toneBlue
class node_java_impl toneAmber
class node_user toneIndigo
```

## Components

### Godot serialization

- [Plugin access](https://github.com/raredeveloperofficials/bam/blob/main/GD/plugin.gd): `GD/plugin.gd`
- [Map conversion](https://github.com/raredeveloperofficials/bam/blob/main/GD/bam.gd): `GD/bam.gd`
- [BAMData](https://github.com/raredeveloperofficials/bam/blob/main/GD/bam.gd): `GD/bam.gd`
- [Key lookup](https://github.com/raredeveloperofficials/bam/blob/main/GD/bam.gd): `GD/bam.gd`
- [Byte utilities](https://github.com/raredeveloperofficials/bam/blob/main/GD/bam.gd): `GD/bam.gd`

### Binary format

- [Java implementation](https://github.com/raredeveloperofficials/bam/blob/main/JAVA/BAM.java): `JAVA/BAM.java`

### Other components

- **Godot application**

## Connections

- Godot application → Plugin access: enables (evidence: `README.md`)
- Plugin access → Map conversion: exposes (evidence: `README.md`)
- Godot application → Map conversion: converts map (evidence: `README.md`)
- Map conversion → BAMData: creates (evidence: `README.md`)
- BAMData → BAMData: serializes bytes (evidence: `README.md`)
- BAMData → BAMData: deserializes bytes (evidence: `README.md`)
- BAMData → Map conversion: restores map (evidence: `README.md`)
- Godot application → Key lookup: looks up key (evidence: `README.md`)
- Key lookup → BAMData: reads value (evidence: `README.md`)
- Godot application → Byte utilities: wraps or extracts (evidence: `README.md`)
- Java implementation → BAMData: shares format
