Copy header into provided writer

@param writer repository writer to verify
@throws IllegalArgumentException if writer is 'null'
1084
public void copyHeader(LogRepositoryWriter writer) throws IllegalArgumentException {
		if (writer == null) {
			throw new IllegalArgumentException("Parameter writer can't be null");
		}
		writer.setHeader(headerBytes);
	}
533051
protected void writeDocumentHeader(XMLEventWriter writer,
                                       String repositoryHash,
                                       Date currentDate)
            throws JournalException {
        try {
            putStartDocument(writer);
            putStartTag(writer, QNAME_TAG_JOURNAL);
            putAttribute(writer, QNAME_ATTR_REPOSITORY_HASH, repositoryHash);
            putAttribute(writer, QNAME_ATTR_TIMESTAMP, JournalHelper
                    .formatDate(currentDate));
        } catch (XMLStreamException e) {
            throw new JournalException(e);
        }
    }
697993
public static void copy(InputStream input, Writer writer) throws IOException {
		copy(new InputStreamReader(input), writer);
	}
593946
final void writeHeader()
                    throws ObjectManagerException
    {
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this,
                        cclass,
                        "writeHeader");

        byteArrayOutputStream.reset();
        java.io.DataOutputStream dataOutputStream = new java.io.DataOutputStream(byteArrayOutputStream);

        // Write the header.
        try {
            dataOutputStream.writeInt(version);
            dataOutputStream.writeChars(signature);
            dataOutputStream.writeLong(objectStoreIdentifier);
            dataOutputStream.writeLong(((Directory.Node) directory.root).byteAddress);
            dataOutputStream.writeLong(((Directory.Node) directory.root).length);
            dataOutputStream.writeInt(directory.getMinimumNodeSize());
            if (freeSpaceStoreArea == null) {
                dataOutputStream.writeLong(0);
                dataOutputStream.writeLong(0);
            } else {
                dataOutputStream.writeLong(freeSpaceStoreArea.byteAddress);
                dataOutputStream.writeLong(freeSpaceStoreArea.length);
            }
            dataOutputStream.writeLong((long) freeSpaceByLength.size());
            dataOutputStream.writeLong(sequenceNumber);
            dataOutputStream.writeLong(storeFileSizeUsed);
            dataOutputStream.writeLong(minimumStoreFileSize);
            dataOutputStream.writeLong(maximumStoreFileSize);
            dataOutputStream.writeInt(cachedManagedObjectsSize);

            dataOutputStream.flush();
            byteArrayOutputStream.flush();
        } catch (java.io.IOException exception) {
            // No FFDC Code Needed.
            ObjectManager.ffdc.processException(this, cclass, "writeHeader", exception, "1:836:1.35");

            if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
                trace.exit(this,
                           cclass,
                           "flush");
            throw new PermanentIOException(this,
                                           exception);
        } // catch.

        byte[] buffer = byteArrayOutputStream.getBuffer();
        int length = byteArrayOutputStream.getCount();
        writeBuffer(buffer,
                    0,
                    length,
                    0);
        // Write the header twice.
        writeBuffer(buffer,
                    0,
                    length,
                    pageSize);

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this,
                       cclass,
                       "writeHeader"
                            );
    }
328919
public void write(Writer out)
         throws IOException
    {
        if (reader==null)
            return;
        
        try{
            IO.copy(reader,out);
        }
        finally
        {
            reader.close();
            reader=null;
        }
    }
48987
public void save(Writer writer, boolean header, boolean flush) throws IOException {
        final PrintWriter out = new PrintWriter(new BufferedWriter(writer));
        try {
            if (header) {
                out.println("<?xml version='1.0' encoding='UTF-8'?>");
            }
            toStringRep("", new XAppender() {
                @Override
                public XAppender append(Object o) {
                    out.print(o);
                    return this;
                }
            });
        } finally {
            if (flush) {
                out.flush();
            }
        }
    }
665211
public void setOutput(java.io.Writer writer) {
        
        fOut = writer instanceof PrintWriter
                ? (PrintWriter)writer : new PrintWriter(writer);
        
    }
28432
public void xmlWriteOn(FormattedWriter writer) throws IOException
  {
    writer.newLine();
    writer.taggedValue("streamId", _streamId);
    writer.taggedValue("streamKey", _streamKey);
  }
418230
private function setWriter($writer = null)
    {
        if ($writer === null) {
            $writer = function ($string) {
                print $string;
            };
        }

        if (!is_callable($writer)) {
            throw new \InvalidArgumentException(
                'Writer must be callable'
            );
        }

        $this->writer = $writer;
    }
37856
public static void toWriter(Node node, Writer writer) throws TransformerException {
		toWriter(node, writer, new HashMap<String, String>());
	}
906841
public <T> void registerWriter(JsonWriterI<T> writer, Class<?>... cls) {
		for (Class<?> c : cls)
			data.put(c, writer);
	}

	/**
	 * Write a Key : value entry to a stream
	 */
	public static void writeJSONKV(String key, Object value, Appendable out, JSONStyle compression) throws IOException {
		if (key == null)
			out.append("null");
		else if (!compression.mustProtectKey(key))
			out.append(key);
		else {
			out.append('"');
			JSONValue.escape(key, out, compression);
			out.append('"');
		}
		compression.objectEndOfKey(out);
		if (value instanceof String) {
			compression.writeString(out, (String) value);
		} else
			JSONValue.writeJSONString(value, out, compression);
		compression.objectElmStop(out);
	}
741276
public void write(Writer writer)
        throws IOException
    {
        synchronized(writer)
        {
            for (int i=0;i<_fields.size();i++)
            {
                Field field=(Field)_fields.get(i);
                if (field!=null)
                    field.write(writer,_version);
            }
            writer.write(__CRLF);
        }
    }
629056
protected function writeHeader(BaseWriterInterface $writer): void
    {
        if ($this->hasMeta() === true) {
            $writer->setMeta($this->getMeta());
        }

        if ($this->hasJsonApiVersion() === true) {
            $writer->setJsonApiVersion($this->getJsonApiVersion());
        }

        if ($this->hasJsonApiMeta() === true) {
            $writer->setJsonApiMeta($this->getJsonApiMeta());
        }

        if ($this->hasLinks() === true) {
            $writer->setLinks($this->getLinks());
        }

        if ($this->hasProfile() === true) {
            $writer->setProfile($this->getProfile());
        }
    }
562343
public void writeParseText(Writer writer) throws IOException {
        require(prefs.readParse, "AgigaPrefs.readParse must be true for writeParseText()");
        writer.write(parseText);
        writer.write("\n");
    }
1134969
@Override
	public int writeTo(BitWriter writer) {
		if (writer == null) throw new IllegalArgumentException("null writer");
		return writer.write(bits, 64);
	}
603157
public void xmlWriteOn(FormattedWriter writer) throws IOException
  {
    super.xmlWriteOn(writer);
    
    writer.newLine();
    writer.taggedValue("subscriberID", _subState.getSubscriberID());

    writer.newLine();
    writer.startTag("topics");
    writer.indent();

    String[] topics = _subState.getTopics();

    if (topics != null)
    {
      for (int i = 0; i < topics.length; i++)
      {
        writer.newLine();
        writer.taggedValue("topic", topics[i]);
      }
    }

    writer.outdent();
    writer.newLine();
    writer.endTag("topics");
    writer.newLine();
    writer.taggedValue("toBeDeleted", toBeDeleted);
  }
485032
public static void put(Writer writer, byte value) throws IOException {
		writer.write(String.valueOf(value));
	}