{"title":"OutStream.Write(Any [, Integer]) Method","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/outstream/outstream-write-joker-integer-method/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/outstream/outstream-write-joker-integer-method, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/outstream/outstream-write-joker-integer-method","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Writes a specified number of bytes to the stream.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"OutStream.Write(Any [, Integer]) Method","slug":"outstreamwriteany-integer-method","at":0,"chars":1496},{"level":2,"title":"Syntax","slug":"syntax","at":186,"chars":83},{"level":2,"title":"Parameters","slug":"parameters","at":269,"chars":418},{"level":2,"title":"Return Value","slug":"return-value","at":687,"chars":227},{"level":2,"title":"Remarks","slug":"remarks","at":914,"chars":225},{"level":2,"title":"Example","slug":"example","at":1139,"chars":220},{"level":2,"title":"Related information","slug":"related-information","at":1359,"chars":137}],"text":"# OutStream.Write(Any [, Integer]) Method\n> Version: _Available or changed with runtime version 2.0._\nWrites a specified number of bytes to the stream. Data is written in binary format.\n## Syntax\n```al\n[Written := ]  OutStream.Write(Value: Any [, Length: Integer])\n```\n## Parameters\nOutStream\nType: outstream-data-type\nAn instance of the outstream-data-type data type.\nValue\nType: ../any/any-data-type\nContains the data to be written.\n*[Optional] Length*\nType: ../integer/integer-data-type\nThe number of bytes to be written. In the case of data types other than string, code, and binary, if you specify a length that differs from the size of the variable, an error message is displayed.\n## Return Value\n*[Optional] Written*\nType: ../integer/integer-data-type\nThe number of bytes that were written. If you omit this optional return value and the operation does not execute successfully, a runtime error will occur.\n## Remarks\nIf the optional return value, Written, is not specified and it was not possible to write all the data, an error message is displayed.\nIf the return value is present, you must verify that all the data was streamed.\n## Example\n```al\nrecBinaries.Find('-');\nrecBinaries.Data.CreateOutstream(OutStream);\nOutStream.Write('Secretary');\nOutStream.Write('Alice');\nOutStream.Write('Hart');\nOutStream.Write(19960106D);\nrecBinaries.Modify();\n```\n## Related information\noutstream-data-type\nGet Started with AL<../../devenv-get-started>\nDeveloping Extensions<../../devenv-dev-overview>"}