public function write()
{
$this->offset = 0;
$this->buffer = "";
if ($this->data instanceof CompoundTag) {
$this->writeTag($this->data);
return $this->buffer;
} elseif (is_array($this->data)) {
foreach ($this->data as $tag) {
$this->writeTag($tag);
}
return $this->buffer;
}
return false;
}