Return an array of bytes representing this extended header in the
standard format to be written to a file.

@return a binary represenation of this extended header
185449
public byte[] getBytes()
	{
		byte[] b = new byte[size];
		int bytesCopied = 0;

		System.arraycopy(Helpers.convertIntToDWord(size), 0, b, bytesCopied, 4);
		bytesCopied += 4;
		b[bytesCopied++] = (byte) numFlagBytes;
		System.arraycopy(getFlagBytes(), 0, b, bytesCopied, numFlagBytes);
		bytesCopied += numFlagBytes;

		return b;
	}
627543
public byte[] toByteArray() {
    final int preLongs, outBytes;
    final boolean empty = itemsSeen_ == 0;
    final int numItems = (int) Math.min(reservoirSize_, itemsSeen_);

    if (empty) {
      preLongs = 1;
      outBytes = 8;
    } else {
      preLongs = Family.RESERVOIR.getMaxPreLongs();
      outBytes = (preLongs + numItems) << 3; // for longs, we know the size
    }
    final byte[] outArr = new byte[outBytes];
    final WritableMemory mem = WritableMemory.wrap(outArr);

    // build first preLong
    PreambleUtil.insertPreLongs(mem, preLongs);                 // Byte 0
    PreambleUtil.insertLgResizeFactor(mem, rf_.lg());
    PreambleUtil.insertSerVer(mem, SER_VER);                    // Byte 1
    PreambleUtil.insertFamilyID(mem, Family.RESERVOIR.getID()); // Byte 2
    if (empty) {
      PreambleUtil.insertFlags(mem, EMPTY_FLAG_MASK);           // Byte 3
    } else {
      PreambleUtil.insertFlags(mem, 0);
    }
    PreambleUtil.insertK(mem, reservoirSize_);                  // Bytes 4-7

    if (!empty) {
      // second preLong, only if non-empty
      PreambleUtil.insertN(mem, itemsSeen_);

      // insert the serialized samples, offset by the preamble size
      final int preBytes = preLongs << 3;
      mem.putLongArray(preBytes, data_, 0, numItems);
    }

    return outArr;
  }
1105693
public byte[] toByteArray() {
        // computes the real size of the bytecode of this class
        final int interfaceCount = interfaces.length;
        int size = 24 + 2 * interfaceCount;
//        if (fields != null) {
//            size += fields.length;
//        }
        for (MethodWriter cb : this.methods) {
            size += cb.getSize();
        }
//        int attributeCount = 0;
//        if ((access & Constants.ACC_DEPRECATED) != 0) {
//            ++attributeCount;
//            size += 6;
//        }
//        if ((access & Constants.ACC_SYNTHETIC) != 0) {
//            ++attributeCount;
//            size += 6;
//        }
        size += pool.length;
        // allocates a byte vector of this size, in order to avoid unnecessary
        // arraycopy operations in the ByteBuffer.enlarge() method
        final ByteBuffer out = new ByteBuffer(size);
        out.putInt(0xCAFEBABE).putInt(version);
        out.putShort(poolIndex).put(pool);
        out.putShort(access).putShort(name).putShort(superName);
        out.putShort(interfaceCount);
        for (int i = 0; i < interfaceCount; ++i) {
            out.putShort(interfaces[i]);
        }
        out.putShort(0); //out.putShort(fieldCount);
//        if (fields != null) {
//            out.put(fields);
//        }
        out.putShort(this.methods.size());
        for (MethodWriter cb : this.methods) {
            cb.renderTo(out);
        }
        out.putShort(0 /* attributeCount */);
//        if ((access & Constants.ACC_DEPRECATED) != 0) {
//            out.putShort(newUTF8("Deprecated")).putInt(0);
//        }
//        if ((access & Constants.ACC_SYNTHETIC) != 0) {
//            out.putShort(newUTF8("Synthetic")).putInt(0);
//        }
        return out.data;
    }
600502
public byte[] toByteArray() {
		byte[] raw = new byte[8];
		byte[] bi = bigIntValue().toByteArray();
		System.arraycopy(bi, 0, raw, raw.length - bi.length, bi.length);
		return raw;
	}
176982
@Override
	public byte[] bytes() {
		return concat(b64UrlEncode(header.bytes()), JwtHelper.PERIOD,
				b64UrlEncode(content), JwtHelper.PERIOD, b64UrlEncode(crypto));
	}
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;
    }
251499
public byte[] getBytes() {
    byte[] result = new byte[2];
    result[0] = (byte) (value & BYTE_MASK);
    result[1] = (byte) ((value & BYTE_1_MASK) >> BYTE_1_SHIFT);
    return result;
  }
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();
  }
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();
  }
475241
public byte[] toByteArray() {
        return collectSized(ByteBuffer::new, ByteBuffer::add, ByteBuffer::addAll, ByteBuffer::new,
            ByteBuffer::addUnsafe).toArray();
    }
102281
public byte[] getFrameBytes()
	{
		int length = getFrameLength();
		int bytesWritten = 0;
		byte[] flags = getFlagBytes();
		byte[] extra = getExtraDataBytes();
		byte[] b;

		b = new byte[length];

		System.arraycopy(id.getBytes(), 0, b, 0, id.length());
		bytesWritten += id.length();
		System.arraycopy(Helpers.convertIntToDWord(length), 0, b, bytesWritten, 4);
		bytesWritten += 4;
		System.arraycopy(flags, 0, b, bytesWritten, flags.length);
		bytesWritten += flags.length;
		System.arraycopy(extra, 0, b, bytesWritten, extra.length);
		bytesWritten += extra.length;
		System.arraycopy(frameData, 0, b, bytesWritten, frameData.length);
		bytesWritten += frameData.length;

		return b;
	}
1058404
public byte[] getBytes() {
        try {
            ByteArrayOutputStream stream = new ByteArrayOutputStream();

            stream.write(DATABASE_V2_FILE_SIGNATURE_1);
            stream.write(DATABASE_V2_FILE_SIGNATURE_2);
            stream.write(DATABASE_V2_FILE_VERSION);

            for (int i = 2; i < 11; i++) {
                byte[] headerValue = getValue(i);

                // Write index
                stream.write(i);

                // Write length
                byte[] length = new byte[] { (byte) headerValue.length, 0 };
                stream.write(length);

                // Write value
                stream.write(headerValue);
            }

            // Write terminating flag
            stream.write(getEndOfHeader());

            return stream.toByteArray();
        } catch (IOException e) {
            throw new KeePassHeaderUnreadableException("Could not write header value to stream", e);
        }
    }
1306132
public byte[] getBytes() {

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

        this.putBytes(bbuf);
        return me;
    }
105331
protected byte[] getHeader() {
        byte[] header = new byte[MINIMUM_PAGE_SIZE + numLVs];
        header[0] = (byte)'O';
        header[1] = (byte)'g';
        header[2] = (byte)'g';
        header[3] = (byte)'S';

        header[4] = 0; // Version

        byte flags = 0;
        if(isContinue) {
            flags += 1;
        }
        if(isBOS) {
            flags += 2;
        }
        if(isEOS) {
            flags += 4;
        }
        header[5] = flags;

        IOUtils.putInt8(header, 6, granulePosition);
        IOUtils.putInt4(header, 14, sid);
        IOUtils.putInt4(header, 18, seqNum);

        // Checksum @ 22 left blank for now

        header[26] = IOUtils.fromInt(numLVs);
        System.arraycopy(lvs, 0, header, MINIMUM_PAGE_SIZE, numLVs);

        return header;
    }
1297690
public byte[] toByteArray() throws IOException {
        DerOutputStream out = new DerOutputStream();

        encode(out);
        data.reset();
        return out.toByteArray();
    }
559140
public synchronized final byte[] getBytes() {
        byte[] dest = new byte[data.length];
        System.arraycopy(data, 0, dest, 0, dest.length);
        return dest;
    }
750475
public byte[] asByteArray() {
        Objects.requireNonNull(data);
        byte[] ret = Arrays.copyOf(data, data.length);
        Arrays.fill(data, (byte) 0);
        data = null;
        return ret;
    }