{"id":28865889,"url":"https://github.com/pb-/streaming-multipart-parser","last_synced_at":"2025-06-29T12:36:47.770Z","repository":{"id":153883253,"uuid":"630186166","full_name":"pb-/streaming-multipart-parser","owner":"pb-","description":"Java library for stream decoding multipart/form-data using constant memory and no disk I/O","archived":false,"fork":false,"pushed_at":"2024-01-06T15:30:54.000Z","size":71,"stargazers_count":4,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-20T10:48:58.228Z","etag":null,"topics":["form-data","multipart","multipart-formdata","streaming"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pb-.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-04-19T21:13:22.000Z","updated_at":"2025-03-14T11:10:55.000Z","dependencies_parsed_at":"2025-06-26T10:46:29.642Z","dependency_job_id":null,"html_url":"https://github.com/pb-/streaming-multipart-parser","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/pb-/streaming-multipart-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pb-%2Fstreaming-multipart-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pb-%2Fstreaming-multipart-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pb-%2Fstreaming-multipart-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pb-%2Fstreaming-multipart-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pb-","download_url":"https://codeload.github.com/pb-/streaming-multipart-parser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pb-%2Fstreaming-multipart-parser/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262596306,"owners_count":23334612,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["form-data","multipart","multipart-formdata","streaming"],"created_at":"2025-06-20T10:39:35.152Z","updated_at":"2025-06-29T12:36:47.735Z","avatar_url":"https://github.com/pb-.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# streaming-multipart-parser\n\nA tiny library for decoding `multipart/form-data` that uses constant memory and no disk I/O. No dependencies apart from JDK 11+.\n\nMany libraries or frameworks to parse this content type will either put files into memory or store them on disk. In some cases neither is an acceptable option. This library effectively provides a standard `Iterator` of `InputStream`s so that each part can be (sequentially) processed as a stream.\n\n\n## Getting it\n\n * Group id: `dev.baecher.multipart`\n * Artifact id: `streaming-multipart-parser`\n * Version: `0.10.0`\n\n\n## Release notes\n\n### 0.10.0\n\n * Added [BoundaryInputStream](src/main/java/dev/baecher/io/BoundaryInputStream.java) which gives low-level access to reading a stream until a boundary is hit. In a future release the multipart parser will use this primitive, but it is useful on its own. Includes some basic optimizations over the naive search algorithm.\n\n### 0.9.7\n\nInitial public release\n\n\n## Usage example\n\nRead all parts and print their file names, content types, and lengths.\n\n```java\n// The parser implements the `Iterator` interface and takes any InputStream\nStreamingMultipartParser parser = new StreamingMultipartParser(someInputStream);\nwhile (parser.hasNext()) {\n    StreamingMultipartParser.Part part = parser.next();\n\n    // A convenience method to parse the filename out of the Content-Disposition header\n    System.out.println(part.getHeaders().getFilename());\n\n    // Any header can be looked up case-insensitively by name, returning the raw value\n    System.out.println(part.getHeaders().getHeaderValue(\"content-type\"));\n\n    // A standard java.io.InputStream of the body\n    System.out.println(part.getInputStream().transferTo(OutputStream.nullOutputStream()));\n}\n```\n\nNote that you have to exhaust the stream of each part (until hitting EOF) before you can move on to the next part. If you want to ignore the body of the part, you can use a construction like in the example above.\n\n\n## Limitations\n\n * No thread safety guaranteed whatsoever.\n * Searching for the part boundary (`Buffer.find()`) is using a very naive algorithm.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpb-%2Fstreaming-multipart-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpb-%2Fstreaming-multipart-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpb-%2Fstreaming-multipart-parser/lists"}