getContents (NotesStream - JavaScript™)
Copies stream contents to a java.io.OutputStream
or java.io.Writer
object.
Defined in
NotesStreamSyntax
getContents(stream:java.io.OutputStream)
: void
getContents(stream:java.io.Writer) : void
Usage
If the native stream has content, the new content is appended.Examples
This button creates a file from the subject and body content of a document.var doc:NotesDocument = currentDocument.getDocument();
var outPath:string = "c:\\" + doc.getItemValueString("subject") + ".txt";
var fos = new java.io.FileOutputStream(outPath);
var osw = new java.io.OutputStreamWriter(fos);
var outStream:NotesStream = session.createStream();
outStream.writeText(doc.getItemValueString("body"));
outStream.getContents(osw);
osw.close();
outStream.close();