Serializes the configuration into bytes, also updates the currently cached m_configBytes.
@return The byte[] of the current configuration.
162859
private byte[] toBytes() {
        ByteBuffer buf = ByteBuffer.allocate(4 + (m_tokenCount * 8));
        buf.putInt(m_tokenCount);
        int lastToken = Integer.MIN_VALUE;
        for (int ii = 0; ii < m_tokenCount; ii++) {
            final long ptr = m_tokens + (ii * 8);
            final int token = Bits.unsafe.getInt(ptr);
            Preconditions.checkArgument(token >= lastToken);
            lastToken = token;
            final int pid = Bits.unsafe.getInt(ptr + 4);
            buf.putInt(token);
            buf.putInt(pid);
        }
        return buf.array();
    }
442689
public byte[] serialize() {
        if (currentByteArrayIndex == 0) {
            return new byte[0];
        }
        final byte[] extractedSerializedData = new byte[currentByteArrayIndex];
        System.arraycopy(serializedData, 0, extractedSerializedData, 0, currentByteArrayIndex);
        return extractedSerializedData;
    }
199249
public byte[] getLengthEncodedBytes() {
    int type = this.buf[this.position++] & 0xff;
    int length;
    switch (type) {
      case 251:
        return null;
      case 252:
        length = 0xffff & readShort();
        break;
      case 253:
        length = 0xffffff & read24bitword();
        break;
      case 254:
        length = (int) ((buf[position++] & 0xff)
            + ((long) (buf[position++] & 0xff) << 8)
            + ((long) (buf[position++] & 0xff) << 16)
            + ((long) (buf[position++] & 0xff) << 24)
            + ((long) (buf[position++] & 0xff) << 32)
            + ((long) (buf[position++] & 0xff) << 40)
            + ((long) (buf[position++] & 0xff) << 48)
            + ((long) (buf[position++] & 0xff) << 56));
        break;
      default:
        length = type;
        break;
    }

    byte[] tmpBuf = new byte[length];
    System.arraycopy(buf, position, tmpBuf, 0, length);
    position += length;
    return tmpBuf;
  }
972377
public static byte[] nextBytes() {
		final ByteBuffer bb = ByteBuffer.wrap(new byte[12]);
		bb.putInt((int) DateUtil.currentSeconds());// 4位
		bb.putInt(machine);// 4位
		bb.putInt(nextInc.getAndIncrement());// 4位

		return bb.array();
	}
104256
public byte[] getBytesF() {
		final int len = getInt();
		final byte[] bytes = new byte[len];
		System.arraycopy(buf, bufPosition, bytes, 0, bytes.length);
		bufPosition += bytes.length;
		return bytes;
	}
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();
  }
567647
@JsonValue
  public byte[] toBytes()
  {
    ByteBuffer buf = ByteBuffer.allocate(getMinStorageSize());
    toBytes(buf);
    return buf.array();
  }
1052092
public byte[] asBytes() {
    byte[] className = tdigest.getClass().getName().getBytes(Charsets.UTF_8);
    int vlen = exactValues == null ? 0 : numExactValues;
    ByteBuffer buf = ByteBuffer.allocate(4 + 8*5 + 4 + 4 + 8*vlen + 4 + className.length + tdigest.byteSize() + 4);
    buf.putInt(MAGIC_CODE); // for sanity checks
    
    // write basic descriptive stats
    buf.putLong(count);
    buf.putDouble(min);
    buf.putDouble(max);
    buf.putDouble(sum);
    buf.putDouble(sumOfSquares);
    
    // write exact values, if any
    buf.putInt(exactQuantilesThreshold);
    buf.putInt(exactValues == null ? -1 : numExactValues);
    if (exactValues != null) {
      for (int i = 0; i < numExactValues; i++) {
        buf.putDouble(exactValues[i]);
      }
    }
    
    // write tdigest
    buf.putInt(className.length);
    buf.put(className);
    tdigest.asBytes(buf);
    
    buf.putInt(MAGIC_CODE); // for sanity checks
    Preconditions.checkArgument(buf.position() == buf.capacity());
    return buf.array();
  }
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();
  }
1030057
private byte[] getFlagBytes()
	{
		byte[] b = new byte[numFlagBytes];
		int bytesCopied = 1;
		b[0] = 0;

		if (update)
		{
			b[0] |= 0x80;
			b[bytesCopied++] = 0;
		}
		if (crced)
		{
			b[0] |= 0x40;
			b[bytesCopied++] = (byte) crc.length;
			System.arraycopy(crc, 0, b, bytesCopied, crc.length);
			bytesCopied += crc.length;
		}
		if ((maxTagSize != -1) || textEncode || (maxTextSize != -1) || imageEncode || (imageRestrict != -1))
		{
			b[0] |= 0x20;
			b[bytesCopied++] = 0x01;
			byte restrict = 0;
			if (maxTagSize != -1) restrict |= (byte)((maxTagSize&0x3)<<6);
			if (textEncode) restrict |= 0x20;
			if (maxTextSize != -1) restrict |= (byte)((maxTextSize&0x3)<<3);
			if (imageEncode) restrict |= 0x04;
			if (imageRestrict != -1) restrict |= (byte)(imageRestrict&0x3);
			b[bytesCopied++] = restrict;
		}

		return b;
	}
414262
public byte[] toBytes() {
        byte[] data = new byte[4];
        data[0] = (byte) (packetBodyLength & 0xFF);
        data[1] = (byte) (packetBodyLength >>> 8);
        data[2] = (byte) (packetBodyLength >>> 16);
        data[3] = getPacketSequenceNumber();
        return data;
    }
1306132
public byte[] getBytes() {

        byte[] me = new byte[CONNECTION_ID_LENGTH];
        ByteBuffer bbuf = ByteBuffer.wrap(me);

        this.putBytes(bbuf);
        return me;
    }
1142753
public byte[] toByteArray() {
        // computes the real size of the bytecode of this class
        int size = 24 + 2 * interfaceCount;
        int nbFields = 0;
        FieldWriter fb = firstField;
        while (fb != null) {
            ++nbFields;
            size += fb.getSize();
            fb = fb.next;
        }
        int nbMethods = 0;
        MethodWriter mb = firstMethod;
        while (mb != null) {
            ++nbMethods;
            size += mb.getSize();
            mb = mb.next;
        }
        int attributeCount = 0;
        if (ClassReader.SIGNATURES && signature != 0) {
            ++attributeCount;
            size += 8;
            newUTF8("Signature");
        }
        if (sourceFile != 0) {
            ++attributeCount;
            size += 8;
            newUTF8("SourceFile");
        }
        if (sourceDebug != null) {
            ++attributeCount;
            size += sourceDebug.length + 4;
            newUTF8("SourceDebugExtension");
        }
        if (enclosingMethodOwner != 0) {
            ++attributeCount;
            size += 10;
            newUTF8("EnclosingMethod");
        }
        if ((access & Opcodes.ACC_DEPRECATED) != 0) {
            ++attributeCount;
            size += 6;
            newUTF8("Deprecated");
        }
        if ((access & Opcodes.ACC_SYNTHETIC) != 0
                && (version & 0xffff) < Opcodes.V1_5)
        {
            ++attributeCount;
            size += 6;
            newUTF8("Synthetic");
        }
        if (innerClasses != null) {
            ++attributeCount;
            size += 8 + innerClasses.length;
            newUTF8("InnerClasses");
        }
        if (ClassReader.ANNOTATIONS && anns != null) {
            ++attributeCount;
            size += 8 + anns.getSize();
            newUTF8("RuntimeVisibleAnnotations");
        }
        if (ClassReader.ANNOTATIONS && ianns != null) {
            ++attributeCount;
            size += 8 + ianns.getSize();
            newUTF8("RuntimeInvisibleAnnotations");
        }
        if (attrs != null) {
            attributeCount += attrs.getCount();
            size += attrs.getSize(this, null, 0, -1, -1);
        }
        size += pool.length;
        // allocates a byte vector of this size, in order to avoid unnecessary
        // arraycopy operations in the ByteVector.enlarge() method
        ByteVector out = new ByteVector(size);
        out.putInt(0xCAFEBABE).putInt(version);
        out.putShort(index).putByteArray(pool.data, 0, pool.length);
        out.putShort(access).putShort(name).putShort(superName);
        out.putShort(interfaceCount);
        for (int i = 0; i < interfaceCount; ++i) {
            out.putShort(interfaces[i]);
        }
        out.putShort(nbFields);
        fb = firstField;
        while (fb != null) {
            fb.put(out);
            fb = fb.next;
        }
        out.putShort(nbMethods);
        mb = firstMethod;
        while (mb != null) {
            mb.put(out);
            mb = mb.next;
        }
        out.putShort(attributeCount);
        if (ClassReader.SIGNATURES && signature != 0) {
            out.putShort(newUTF8("Signature")).putInt(2).putShort(signature);
        }
        if (sourceFile != 0) {
            out.putShort(newUTF8("SourceFile")).putInt(2).putShort(sourceFile);
        }
        if (sourceDebug != null) {
            int len = sourceDebug.length - 2;
            out.putShort(newUTF8("SourceDebugExtension")).putInt(len);
            out.putByteArray(sourceDebug.data, 2, len);
        }
        if (enclosingMethodOwner != 0) {
            out.putShort(newUTF8("EnclosingMethod")).putInt(4);
            out.putShort(enclosingMethodOwner).putShort(enclosingMethod);
        }
        if ((access & Opcodes.ACC_DEPRECATED) != 0) {
            out.putShort(newUTF8("Deprecated")).putInt(0);
        }
        if ((access & Opcodes.ACC_SYNTHETIC) != 0
                && (version & 0xffff) < Opcodes.V1_5)
        {
            out.putShort(newUTF8("Synthetic")).putInt(0);
        }
        if (innerClasses != null) {
            out.putShort(newUTF8("InnerClasses"));
            out.putInt(innerClasses.length + 2).putShort(innerClassesCount);
            out.putByteArray(innerClasses.data, 0, innerClasses.length);
        }
        if (ClassReader.ANNOTATIONS && anns != null) {
            out.putShort(newUTF8("RuntimeVisibleAnnotations"));
            anns.put(out);
        }
        if (ClassReader.ANNOTATIONS && ianns != null) {
            out.putShort(newUTF8("RuntimeInvisibleAnnotations"));
            ianns.put(out);
        }
        if (attrs != null) {
            attrs.put(this, null, 0, -1, -1, out);
        }
        if (invalidFrames) {
            ClassWriter cw = new ClassWriter(COMPUTE_FRAMES);
            new ClassReader(out.data).accept(cw, ClassReader.SKIP_FRAMES);
            return cw.toByteArray();
        }
        return out.data;
    }
1348696
public byte[] getMessage() {
        byte result[] = new byte[3 + m_length];
        int offset = 0;

        result[offset++] = (byte)(m_length + 2);
        result[offset++] = (byte)m_slaveId;
        result[offset++] = (byte)m_status;
        if (m_length > 0) {
            System.arraycopy(m_data, 0, result, offset, m_length - 2);
        }

        return result;
    }
382299
public byte[] getBytes() {
    // avoid copy if `base` is `byte[]`
    if (offset == BYTE_ARRAY_OFFSET && base instanceof byte[]
      && ((byte[]) base).length == numBytes) {
      return (byte[]) base;
    } else {
      byte[] bytes = new byte[numBytes];
      copyMemory(base, offset, bytes, BYTE_ARRAY_OFFSET, numBytes);
      return bytes;
    }
  }
1228664
public byte[] toByteArray()
	{
		final byte[] data = new byte[7];
		data[0] = (byte) oindex;
		data[1] = (byte) id;
		data[2] = (byte) pindex;
		data[3] = (byte) (write ? 0x80 : 0x00);
		data[3] |= pdt & 0x3f;
		data[4] = (byte) (maxElems >> 8);
		data[5] = (byte) maxElems;
		data[6] = (byte) (rLevel << 4 | (wLevel & 0x0f));
		return data;
	}
1170775
public byte[] getBytes() {
		final int len = getVInt();
		final byte[] bytes = new byte[len];
		System.arraycopy(buf, bufPosition, bytes, 0, bytes.length);
		bufPosition += bytes.length;
		return bytes;
	}