/** * Writes the header to the OutputStreamCounter. * @throws IOException */ public void writeHeader(OutputStreamCounter os) throws IOException { if (appendmode) { os.write(HEADER[0]); } else { os.write(HEADER[1]); os.write(getVersionAsByteArray(header_version)); os.write(HEADER[2]); headerWasWritten = true; } }
/** * Constructs a <CODE>DocWriter</CODE>. * * @param document The <CODE>Document</CODE> that has to be written * @param os The <CODE>OutputStream</CODE> the writer has to write to. */ protected DocWriter(Document document, OutputStream os) { this.document = document; this.os = new OutputStreamCounter(new BufferedOutputStream(os)); }