Search completed in 1.01 seconds.
3 results for "writeByteArray":
nsIBinaryOutputStream
MozillaTechXPCOMReferenceInterfacensIBinaryOutputStream
inherits from: nsioutputstream last changed in gecko 1.7 method overview void setoutputstream(in nsioutputstream aoutputstream); void write8(in pruint8 abyte); void write16(in pruint16 a16); void write32(in pruint32 a32); void write64(in pruint64 a64); void writeboolean(in prbool aboolean); void writebytearray([array, size_is(alength)] in pruint8 abytes, in pruint32 alength); void writebytes(alength)] in string astring, in pruint32 alength); void writedouble(in double adouble); void writefloat(in float afloat); void writestringz(in string astring); void writeutf8z(in wstring astring); void writewstringz(in wstring astring); methods setoutputstream() sets the stream to which output is dir...
... writebytearray() writes an opaque byte array to the stream.
... void writebytearray( [array, size_is(alength)] in pruint8 abytes, in pruint32 alength ); parameters abytes the bytes to write to the stream.
Writing to Files - Archive of obsolete content
ArchiveMozillaXULFileGuideFileWriting
if you want to write a negative value, use the following calculation first to convert the value: function writenegative(val) { if (val > 0x7fff) val = ~(0x10000 - val - 1); stream.write16(val); } one last method that is useful for writing to binary streams is the writebytearray method, used to write an array of bytes.
...stream.writebytearray([25, 77, 46, 8]); this example uses the writebytearray method to write 4 bytes to the stream.
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
ArchiveAdd-onsOverlay ExtensionsFirefox addons developer guideUsing XPCOM—Implementing advanced processes
tream = components.classes['@mozilla.org/network/file-output-stream;1'] .createinstance(components.interfaces.nsifileoutputstream); filestream.init(file, 2, 0x200, false); var binarystream = components.classes['@mozilla.org/binaryoutputstream;1'] .createinstance(components.interfaces.nsibinaryoutputstream); binarystream.setoutputstream(filestream); binarystream.writebytearray(array , array.length); binarystream.close(); filestream.close(); text file i/o text files are read the same way streams are.