{
    "content": [
        {
            "type": "text",
            "text": "# MongoDB::GridFSBucket::DownloadStream (perldoc)\n\n## NAME\n\nMongoDB::GridFSBucket::DownloadStream - File handle abstraction for downloading\n\n## SYNOPSIS\n\n# OO API\n$stream = $bucket->opendownloadstream($fileid)\nwhile ( my $line = $stream->readline ) {\n...\n}\n# Tied-handle API\n$fh = $stream->fh;\nwhile ( my $line = <$fh> ) {\n...\n}\n\n## DESCRIPTION\n\nThis class provides a file abstraction for downloading. You can stream data from an object of\nthis class using method calls or a tied-handle interface.\n\n## Sections\n\n- **NAME**\n- **VERSION**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **ATTRIBUTES**\n- **METHODS**\n- **AUTHORS**\n- **COPYRIGHT AND LICENSE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "MongoDB::GridFSBucket::DownloadStream",
        "section": "",
        "mode": "perldoc",
        "summary": "MongoDB::GridFSBucket::DownloadStream - File handle abstraction for downloading",
        "synopsis": "# OO API\n$stream = $bucket->opendownloadstream($fileid)\nwhile ( my $line = $stream->readline ) {\n...\n}\n# Tied-handle API\n$fh = $stream->fh;\nwhile ( my $line = <$fh> ) {\n...\n}",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "VERSION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 12,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "ATTRIBUTES",
                "lines": 25,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 58,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 10,
                "subsections": []
            },
            {
                "name": "COPYRIGHT AND LICENSE",
                "lines": 6,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "MongoDB::GridFSBucket::DownloadStream - File handle abstraction for downloading\n",
                "subsections": []
            },
            "VERSION": {
                "content": "version v2.2.2\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "# OO API\n$stream = $bucket->opendownloadstream($fileid)\nwhile ( my $line = $stream->readline ) {\n...\n}\n\n# Tied-handle API\n$fh = $stream->fh;\nwhile ( my $line = <$fh> ) {\n...\n}\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This class provides a file abstraction for downloading. You can stream data from an object of\nthis class using method calls or a tied-handle interface.\n",
                "subsections": []
            },
            "ATTRIBUTES": {
                "content": "filedoc\nThe file document for the file to be downloaded.\n\nValid file documents typically include the following fields:\n\n*   id – a unique ID for this document, typically a BSON::OID object. Legacy GridFS files may\nstore this value as a different type.\n\n*   length – the length of this stored file, in bytes\n\n*   chunkSize – the size, in bytes, of each full data chunk of this file.\n\n*   uploadDate – the date and time this file was added to GridFS, stored as a BSON datetime\nvalue and inflated per the bucket's bsoncodec attribute.\n\n*   filename – the name of this stored file; this does not need to be unique\n\n*   metadata – any additional application-specific data\n\n*   md5 – DEPRECATED\n\n*   contentType – DEPRECATED\n\n*   aliases – DEPRECATED\n",
                "subsections": []
            },
            "METHODS": {
                "content": "fh\nmy $fh = $downloadstream->fh;\nwhile ( <$fh> ) {\nsay($);\n}\n\nReturns a new Perl file handle tied to this instance of DownloadStream that can be operated on\nwith the built-in functions \"read\", \"readline\", \"getc\", \"eof\", \"fileno\" and \"close\".\n\nImportant notes:\n\nAllowing one of these tied filehandles to fall out of scope will NOT cause close to be called.\nThis is due to the way tied file handles are implemented in Perl. For close to be called\nimplicitly, all tied filehandles and the original object must go out of scope.\n\nEach file handle retrieved this way is tied back to the same object, so calling close on\nmultiple tied file handles and/or the original object will have the same effect as calling close\non the original object multiple times.\n\nclose\n$stream->close\n\nWorks like the builtin \"close\".\n\nImportant notes:\n\n*   Calling close will also cause any tied file handles created for the stream to also close.\n\n*   \"close\" will be automatically called when a stream object is destroyed.\n\n*   Calling \"close\" repeatedly will warn.\n\neof\nif ( $stream->eof() ) { ... }\n\nWorks like the builtin \"eof\".\n\nfileno\nif ( $stream->fileno() ) { ... }\n\nWorks like the builtin \"fileno\", but it returns -1 if the stream is open and undef if closed.\n\ngetc\n$char = $stream->getc();\n\nWorks like the builtin \"getc\".\n\nread\n$data = $stream->read($buf, $length, $offset)\n\nWorks like the builtin \"read\".\n\nreadline\n$line  = $stream->readline();\n@lines = $stream->readline();\n\nWorks like the builtin \"readline\".\n",
                "subsections": []
            },
            "AUTHORS": {
                "content": "*   David Golden <david@mongodb.com>\n\n*   Rassi <rassi@mongodb.com>\n\n*   Mike Friedman <friedo@friedo.com>\n\n*   Kristina Chodorow <k.chodorow@gmail.com>\n\n*   Florian Ragwitz <rafl@debian.org>\n",
                "subsections": []
            },
            "COPYRIGHT AND LICENSE": {
                "content": "This software is Copyright (c) 2020 by MongoDB, Inc.\n\nThis is free software, licensed under:\n\nThe Apache License, Version 2.0, January 2004\n",
                "subsections": []
            }
        }
    }
}