Serialize this Zxid into a fixed size (8 bytes) byte array.

The resulting byte array can be deserialized with fromByteArray.
@return an array of bytes.
@throws IOException in case of an IO failure
19182
public byte[] toByteArray() throws IOException {
    ByteArrayOutputStream bout = new ByteArrayOutputStream();
    DataOutputStream out = new DataOutputStream(new BufferedOutputStream(bout));
    out.writeLong(this.epoch);
    out.writeLong(this.xid);
    out.flush();
    return bout.toByteArray();
  }
412072
public byte[] toBytes() throws IOException {
    final ByteArrayOutputStream outBuffer = new ByteArrayOutputStream();
    final BitOutputStream out = new BitOutputStream(outBuffer);
    this.write(out);
    out.flush();
    return outBuffer.toByteArray();
  }
415666
protected byte[] serializeObject(Serializable theObject) throws IOException {

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ObjectOutputStream oout = new ObjectOutputStream(baos);
        oout.writeObject(theObject);
        byte[] data = baos.toByteArray();
        baos.close();
        oout.close();

        return data;
    }
1090085
public byte[] getBytes() {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    try {
      workbook.write(baos);
    } catch (IOException e) {
      new RuntimeException(e);
    } finally {
      if (baos != null)
        try {
          baos.close();
        } catch (IOException e) {
          new RuntimeException(e);
        }
    }
    return baos.toByteArray();
  }
1013869
@Override
    public byte[] serialize() {
        byte[] result = new byte[SERIALIZATION_LENGTH];
        BitConverter.writeLong(result, 0, this.segmentId);
        BitConverter.writeLong(result, Long.BYTES, this.offset);
        return result;
    }
291735
public byte[] encode() throws IOException {
        final ByteBuffer buf = ByteBuffer.allocate(totalSize());
        log.debug("Tag: " + this);
        buf.put(id.encode());
        buf.put(size.encode());
        putValue(buf);
        buf.flip();
        return buf.array();
    }
1021552
public byte[] toByteArray() {
    final byte[] bytes = new byte[getSerializedSizeBytes()];
    final boolean isSingleItem = n_ == 1;
    bytes[PREAMBLE_INTS_BYTE] = (byte) (isEmpty() || isSingleItem ? PREAMBLE_INTS_SHORT : PREAMBLE_INTS_FULL);
    bytes[SER_VER_BYTE] = isSingleItem ? serialVersionUID2 : serialVersionUID1;
    bytes[FAMILY_BYTE] = (byte) Family.KLL.getID();
    bytes[FLAGS_BYTE] = (byte) (
        (isEmpty() ? 1 << Flags.IS_EMPTY.ordinal() : 0)
      | (isLevelZeroSorted_ ? 1 << Flags.IS_LEVEL_ZERO_SORTED.ordinal() : 0)
      | (isSingleItem ? 1 << Flags.IS_SINGLE_ITEM.ordinal() : 0)
    );
    ByteArrayUtil.putShortLE(bytes, K_SHORT, (short) k_);
    bytes[M_BYTE] = (byte) m_;
    if (isEmpty()) { return bytes; }
    int offset = DATA_START_SINGLE_ITEM;
    if (!isSingleItem) {
      ByteArrayUtil.putLongLE(bytes, N_LONG, n_);
      ByteArrayUtil.putShortLE(bytes, MIN_K_SHORT, (short) minK_);
      bytes[NUM_LEVELS_BYTE] = (byte) numLevels_;
      offset = DATA_START;
      // the last integer in levels_ is not serialized because it can be derived
      for (int i = 0; i < numLevels_; i++) {
        ByteArrayUtil.putIntLE(bytes, offset, levels_[i]);
        offset += Integer.BYTES;
      }
      ByteArrayUtil.putFloatLE(bytes, offset, minValue_);
      offset += Float.BYTES;
      ByteArrayUtil.putFloatLE(bytes, offset, maxValue_);
      offset += Float.BYTES;
    }
    final int numItems = getNumRetained();
    for (int i = 0; i < numItems; i++) {
      ByteArrayUtil.putFloatLE(bytes, offset, items_[levels_[0] + i]);
      offset += Float.BYTES;
    }
    return bytes;
  }
506181
public byte[] toByteArray()
	{
		final ByteArrayOutputStream os = new ByteArrayOutputStream();
		os.write(length);
		os.write(connType);
		os.write(opt, 0, opt.length);
		return os.toByteArray();
	}
868731
public byte[] getBytes() {
		byte[] bytes = new byte[SIZE];
		longToByteArray(lowerPart, bytes, 0);
		longToByteArray(upperPart, bytes, SIZE_OF_LONG);
		return bytes;
	}
1297690
public byte[] toByteArray() throws IOException {
        DerOutputStream out = new DerOutputStream();

        encode(out);
        data.reset();
        return out.toByteArray();
    }
131155
public byte[] getBytes() {
        if (!changed) {
            return buf;
        }
        
        byte[] newBuf = new byte[bufLen];
        System.arraycopy(buf, 0, newBuf, 0, bufLen);
        buf = newBuf;
        return buf;
    }
368959
public static byte[] getBytes(Object obj) throws IOException {
		ByteArrayOutputStream bos = new ByteArrayOutputStream();
		ObjectOutputStream oos = new ObjectOutputStream(bos);
		oos.writeObject(obj);
		oos.flush();
		oos.close();
		bos.close();
		byte[] data = bos.toByteArray();
		return data;
	}
952440
public byte[] getContentAsByteArray() {
        if (content == null) {
            try {
                content = IOHelper.byteArrayFromStream(is);
            } catch (IOException e) {
                throw new RuntimeException("IOException buffering binary data",
                        e);
            }
            is = null;
        }
        return content;
    }
1306706
public synchronized byte[] readBytes() throws IOException
    {
        final int dataLength = dataInputStream.readInt();
        final byte[] data = new byte[dataLength];

        final int dataRead = dataInputStream.read(data, 0, dataLength);
        if (dataRead != dataLength) throw new IOException("Not enough data available");

        return data;
    }
1186053
public byte[] getBytes()
    {
        int length = _eob - _start;
        byte[] copy = new byte[length];
        System.arraycopy(_bytes, _start, copy, 0, length);
        return copy;
    }
841103
public byte[] toByteArray()
    {
        byte[] data = new byte[getSize()];
        int off = 0;
        for (MessageBuffer buffer : list) {
            buffer.getBytes(0, data, off, buffer.size());
            off += buffer.size();
        }
        return data;
    }
50538
public byte[] toStream(final Object iObject) throws IOException {
		if (iObject == null)
			return null;

		if (!(iObject instanceof OSerializableStream))
			throw new OSerializationException("Cannot serialize the object [" + iObject.getClass() + ":" + iObject
					+ "] since it does not implement the OSerializableStream interface");

		OSerializableStream stream = (OSerializableStream) iObject;

		// SERIALIZE THE CLASS NAME
		final byte[] className;
		if (iObject instanceof OCommandSQL)
			className = SQL_COMMAND_CLASS_ASBYTES;
		else if (iObject instanceof OCommandScript)
			className = SCRIPT_COMMAND_CLASS_ASBYTES;
		else
			className = OBinaryProtocol.string2bytes(iObject.getClass().getName());

		// SERIALIZE THE OBJECT CONTENT
		byte[] objectContent = stream.toStream();

		byte[] result = new byte[4 + className.length + objectContent.length];

		// COPY THE CLASS NAME SIZE + CLASS NAME + OBJECT CONTENT
		System.arraycopy(OBinaryProtocol.int2bytes(className.length), 0, result, 0, 4);
		System.arraycopy(className, 0, result, 4, className.length);
		System.arraycopy(objectContent, 0, result, 4 + className.length, objectContent.length);

		return result;
	}