{
  "id": 16170621,
  "title": "How I built EasyShare: peer-to-peer file sharing in Java",
  "url": "https://urgent.news/2026/10/23/how-i-built-easyshare-peer-to-peer-file-sharing-in-java",
  "topic": "world",
  "section": "World",
  "published": "2026-10-23T09:50:57.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/niranjan_4407/how-i-built-easyshare-peer-to-peer-file-sharing-in-java-1p46"
  },
  "original_language": "en",
  "account": "Niranjan developed EasyShare, a peer-to-peer file sharing application in Java, without relying on any external libraries. The program splits files into pieces, verifies each piece using SHA-1 hashing, and enables parallel downloads from multiple peers while still downloading the file themselves. You can try the application live, and access its source code.\n\nThe primary objective was to transfer files between computers without the need for a central file server, and to ensure that every byte received is the exact byte that was sent. All received pieces are hashed using SHA-1, and any corrupt pieces are rejected and redownloaded. The demo includes a peer that intentionally corrupts 15% of the pieces it sends, demonstrating the effectiveness of the check.\n\nThe application uses rarest-first selection for the swarm, allowing peers to share pieces while they are still downloading and preventing a single machine from becoming a bottleneck. To discover other peers, EasyShare utilizes three methods: a TCP tracker, LAN multicast over UDP, and manual connection through ip:port. The application has no external dependencies beyond the Java Development Kit (JDK).\n\nEasyShare can pause and resume file transfers, ensuring that progress is not lost when the program is restarted. Additionally, it features a web dashboard and a phone page for devices connected to the same Wi-Fi network. The program was built using Java 17, TCP and UDP sockets, multithreading, SHA-1 hashing, and HTML.",
  "summary": "BitTorrent-style file sharing in plain Java with no external libraries. Files are split into pieces, every piece is SHA-1 checked, and peers download from each other in parallel while still downloading themselves. Try it live · Source code The problem Move files between computers with no central file server, and prove that every byte that arrives is the byte that was sent. Decisions that shaped…",
  "key_points": [],
  "editors_take": "Building a decentralized file-sharing system without external libraries demonstrates how core Java capabilities can effectively manage complex tasks like data integrity and peer discovery in a distributed network.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}