{"id":16304852,"url":"https://github.com/moznion/p6-io-blob","last_synced_at":"2025-07-11T13:08:05.530Z","repository":{"id":47634618,"uuid":"43210395","full_name":"moznion/p6-IO-Blob","owner":"moznion","description":"IO:: interface for reading/writing a Blob","archived":false,"fork":false,"pushed_at":"2021-08-20T12:14:54.000Z","size":32,"stargazers_count":4,"open_issues_count":4,"forks_count":9,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-07-06T20:13:46.113Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Raku","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"artistic-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moznion.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-09-26T15:19:20.000Z","updated_at":"2021-08-20T12:14:57.000Z","dependencies_parsed_at":"2022-09-23T14:31:33.525Z","dependency_job_id":null,"html_url":"https://github.com/moznion/p6-IO-Blob","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/moznion/p6-IO-Blob","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2Fp6-IO-Blob","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2Fp6-IO-Blob/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2Fp6-IO-Blob/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2Fp6-IO-Blob/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moznion","download_url":"https://codeload.github.com/moznion/p6-IO-Blob/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2Fp6-IO-Blob/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264816248,"owners_count":23668157,"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":[],"created_at":"2024-10-10T21:04:58.401Z","updated_at":"2025-07-11T13:08:05.512Z","avatar_url":"https://github.com/moznion.png","language":"Raku","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/moznion/p6-IO-Blob.svg?branch=master)](https://travis-ci.org/moznion/p6-IO-Blob)\n\nNAME\n====\n\nIO::Blob - IO:: interface for reading/writing a Blob\n\nSYNOPSIS\n========\n\n    use v6;\n    use IO::Blob;\n\n    my $data = \"foo\\nbar\\n\";\n    my IO::Blob $io = IO::Blob.new($data.encode);\n\n    $io.get; # =\u003e \"foo\\n\"\n\n    $io.print('buz');\n\n    $io.seek(0); # rewind\n\n    $io.slurp-rest; # =\u003e \"foo\\nbar\\nbuz\"\n\nDESCRIPTION\n===========\n\n`IO::` interface for reading/writing a Blob. This class inherited from [IO::Handle](IO::Handle).\n\nThe IO::Blob class implements objects which behave just like IO::Handle objects, except that you may use them to write to (or read from) Blobs.\n\nThis module is inspired by IO::Scalar of perl5.\n\nMETHODS\n=======\n\nnew(Blob $data = Buf.new)\n-------------------------\n\nMake a instance. This method is equivalent to `open`.\n\n    my $io = IO::Blob.new(\"foo\\nbar\\n\".encode);\n\nopen(Blob $data = Buf.new)\n--------------------------\n\nMake a instance. This method is equivalent to `new`.\n\n    my $io = IO::Blob.open(\"foo\\nbar\\n\".encode);\n\nnew(Str $str)\n-------------\n\nMake a instance. This method is equivalent to `open`.\n\n    my $io = IO::Blob.new(\"foo\\nbar\\n\");\n\nopen(Str $str)\n--------------\n\nMake a instance. This method is equivalent to `new`.\n\n    my $io = IO::Blob.open(\"foo\\nbar\\n\");\n\nget(IO::Blob:D:)\n----------------\n\nReads a single line from the Blob.\n\n    my $io = IO::Blob.open(\"foo\\nbar\\n\".encode);\n    $io.get; # =\u003e \"foo\\n\"\n\ngetc(IO::Blob:D:)\n-----------------\n\nRead a single character from the Blob.\n\n    my $io = IO::Blob.open(\"foo\\nbar\\n\".encode);\n    $io.getc; # =\u003e \"f\\n\"\n\nlines(IO::Blob:D: $limit = Inf)\n-------------------------------\n\nReturn a lazy list of the Blob's lines read via `get`, limited to `$limit` lines.\n\n    my $io = IO::Blob.open(\"foo\\nbar\\n\".encode);\n    for $io.lines -\u003e $line {\n        $line; # 1st: \"foo\\n\", 2nd: \"bar\\n\"\n    }\n\nword(IO::Blob:D:)\n-----------------\n\nRead a single word (separated on whitespace) from the Blob.\n\n    my $io = IO::Blob.open(\"foo bar\\tbuz\\nqux\".encode);\n    $io.word; # =\u003e \"foo \"\n\nwords(IO::Blob:D: $count = Inf)\n-------------------------------\n\nReturn a lazy list of the Blob's words (separated on whitespace) read via `word`, limited to `$count` words.\n\n    my $io = IO::Blob.open(\"foo bar\\tbuz\\nqux\".encode);\n    for $io.words -\u003e $word {\n        $word; # 1st: \"foo \", 2nd: \"bar\\t\", 3rd: \"buz\\n\", 4th: \"qux\"\n    }\n\nprint(IO::Blob:D: *@text) returns Bool\n--------------------------------------\n\nText writing; writes the given `@text` to the Blob.\n\nsay(IO::Blob:D: *@text) returns Bool\n------------------------------------\n\nText writing; similar to print, but add a newline to end of the `@text`.\n\nread(IO::Blob:D: Int(Cool:D) $bytes)\n------------------------------------\n\nBinary reading; reads and returns `$bytes` bytes from the Blob.\n\nwrite(IO::Blob:D: Blob:D $buf)\n------------------------------\n\nBinary writing; writes $buf to the Blob.\n\nseek(IO::Blob:D: int $offset, SeekType:D $whence = SeekFromBeginning)\n---------------------------------------------------------------------\n\nMove the pointer (that is the position at which any subsequent read or write operations will begin,) to the byte position specified by `$offset` relative to the location specified by `$whence` which may be one of:\n\n  * SeekFromBeginning\n\nThe beginning of the file.\n\n  * SeekFromCurrent\n\nThe current position in the file.\n\n  * SeekFromEnd\n\nThe end of the file.\n\ntell(IO::Blob:D:) returns Int\n-----------------------------\n\nReturns the current position of the pointer in bytes.\n\nins(IO::Blob:D:) returns Int\n----------------------------\n\nReturns the number of lines read from the file.\n\nslurp-rest(IO::Blob:D: :$bin!) returns Buf\n------------------------------------------\n\nReturn the remaining content of the Blob from the current position (which may have been set by previous reads or by seek.) If the adverb `:bin` is provided a Buf will be returned.\n\nslurp-rest(IO::Blob:D: :$enc = 'utf8') returns Str\n--------------------------------------------------\n\nReturn the remaining content of the Blob from the current position (which may have been set by previous reads or by seek.) Return will be a Str with the optional encoding `:enc`.\n\neof(IO::Blob:D:)\n----------------\n\nReturns [Bool::True](Bool::True) if the read operations have exhausted the content of the Blob;\n\nclose(IO::Blob:D:)\n------------------\n\nWill close a previously opened Blob.\n\nis-closed(IO::Blob:D:)\n----------------------\n\nReturns [Bool::True](Bool::True) if the Blob is closed.\n\ndata(IO::Blob:D:)\n-----------------\n\nReturns the current Blob.\n\nSEE ALSO\n========\n\n[IO::Scalar of perl5](https://metacpan.org/pod/IO::Scalar)\n\nAUTHOR\n======\n\nmoznion \u003cmoznion@gmail.com\u003e\n\nCONTRIBUTORS\n============\n\n  * mattn\n\n  * shoichikaji\n\nLICENSE\n=======\n\nCopyright 2015 moznion \u003cmoznion@gmail.com\u003e\n\nThis library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoznion%2Fp6-io-blob","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoznion%2Fp6-io-blob","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoznion%2Fp6-io-blob/lists"}