{"id":19660073,"url":"https://github.com/germancoding/packetapi","last_synced_at":"2026-06-11T08:31:49.155Z","repository":{"id":30574248,"uuid":"34129217","full_name":"GermanCoding/PacketAPI","owner":"GermanCoding","description":"A little Java API to send and receive packets over any network. Has TCP \u0026 UDP support inbuild (but is also usable with Reliable UDP or any other stream-orientated network)","archived":false,"fork":false,"pushed_at":"2021-11-23T22:23:18.000Z","size":148,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-18T07:58:37.324Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GermanCoding.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-17T17:04:35.000Z","updated_at":"2024-11-04T17:28:32.000Z","dependencies_parsed_at":"2022-08-30T05:32:35.394Z","dependency_job_id":null,"html_url":"https://github.com/GermanCoding/PacketAPI","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/GermanCoding/PacketAPI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GermanCoding%2FPacketAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GermanCoding%2FPacketAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GermanCoding%2FPacketAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GermanCoding%2FPacketAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GermanCoding","download_url":"https://codeload.github.com/GermanCoding/PacketAPI/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GermanCoding%2FPacketAPI/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34190583,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T15:45:12.575Z","updated_at":"2026-06-11T08:31:49.130Z","avatar_url":"https://github.com/GermanCoding.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PacketAPI\nA little Java API to send and receive packets over any network. Has TCP \u0026amp; UDP support inbuild (but is also usable with Reliable UDP or any other stream-orientated network)\n\nThis library is designed to easily receive and send data over any network protocol. Data is send in packets which\nare defined by this library (default packets) or by the user (user packets).\nThe PacketAPI works stream-orientated. All data is send to an OutputStream and read from an InputStream. There is also some basic UDP support.\n\nPackets\n--\nA packet is only a pack of some bytes. Packets are designed to have less overhead. A packet looks like this:\n\n\t\u003cLENGTH\u003e\u003cPACKET_ID\u003e\u003cDATA\u003e\n\t\n\"LENGTH\" are 4 bytes (parsed as a signed integer)\n\n\"PACKET_ID\" is the ID of the packet, a two-byte short (also signed, though all ID's should be positive).\n\n\"DATA\" are as many bytes as you want containing your packet data.\n\n\nNote:\nWhen using raw UDP: Avoid sending large packets (Bigger than UnreliableSocket.MAX_PACKET_SIZE) because otherwise the\npacket will be splitted and if one of the splitted packets is lost or not received in order the whole connection\ncould fail (or at least the parsing). Sending such big packets is possible though.\n\nDownload\n--\nYou can download a up to date pre-compiled version of this API here (Compiled with Java 11):\nhttps://build.germancoding.com/job/PacketAPI/lastSuccessfulBuild/artifact/PacketAPI/dist/lib/PacketAPI.jar\n\nOf course you can also download/clone the source and compile it for yourself.\n\nJavadoc\n--\nThe javadoc of this project is available here: https://build.germancoding.com/job/PacketAPI/javadoc\n\nUsage\n--\nTo create a new connection using the PacketAPI, simply create a new PacketHandler object.\n```\nPacketHandler myNewHandler = new PacketHandler(in, out, \"Hello!\", myListener);\n```\n'In' must be some InputStream which is already connected with your remote partner. 'Out' is the corresponding OutputStream. 'myListener' is a PacketListener which is notified when something happens. You can create a new one or set it to null.\n\nUsing the PacketAPI with UDP\n--\nSince the PacketAPI uses streams to send/receive data you might think that you can not use UDP. Wrong! The PacketAPI has support for UDP:\n```\nUnreliableSocket myUDPSocket = new UnreliableSocket(someUDPSocket);\nPacketHandler myNewHandler = new PacketHandler(myUDPSocket.getInputStream(), myUDPSocket.getOutputStream(), \"Hello!\", myListener);\n```\n\nFor more informations about the constructors and the methods, please read the javadocs. Not all methods are documentated yet but the most important things are.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgermancoding%2Fpacketapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgermancoding%2Fpacketapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgermancoding%2Fpacketapi/lists"}