.\" This man page is automatically generated using .\" kayadoc2man from the Kaya development tools and the -xmldocs compile .\" option. Editing it directly is not encouraged. .\" It is under the same license as the source .k file that it was .\" generated from. .TH "Binary.setBlockData" "3kaya" "August 2014" "Kaya" "Kaya module reference" .SH "NAME" Binary::setBlockData \- Set the contents of a block. .SH "SYNOPSIS" .B Void setBlockData( \fIvar Binary block, Int offset, [Int] bdata\fP .B ")" .SH "ARGUMENTS" .PP .B "block" The binary block .PP .B "offset" The offset to start at (zero-indexed) .PP .B "bdata" The data to write, as an array of \fBInt \fP s .SH "DESCRIPTION" .PP Set the contents of (part of) a block from an array. An .B "Binary.OffsetOutOfRange"(3kaya) Exception will be thrown if this would cause a write outside the bounds of the block. The following bits of code are equivalent: .IP "" -4 setBlockData(block,offset,bdata); // is equivalent to for byte@idx in bdata { poke(block,offset+idx,byte); } .PP However, \fBsetBlockData \fP is more efficient and checks bounds before any data is written - the above for loop could write partial data if \fBoffset+idx \fP was greater than \fBblockSize(block) \fP .SH "AUTHORS" Kaya standard library by Edwin Brady, Chris Morris and others (kaya@kayalang.org). For further information see http://kayalang.org/ .SH LICENSE The Kaya standard library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (version 2.1 or any later version) as published by the Free Software Foundation. .SH "RELATED" .PD 0 .PP .B "Binary.Binary"(3kaya) .PP .B "Binary.array"(3kaya) .PP .B "Binary.copyBlock"(3kaya) .PP .B "Binary.getBlockChunk"(3kaya) .PP .B "Binary.poke"(3kaya) .PP .B "Binary.pokeString"(3kaya) .PD 0.4v