Returns a ByteArray containing the serialized BeanId that corresponds
to this WrapperId instance. <p>
325167
public ByteArray getBeanIdArray()
    {
        int beanIdLength = data.length - ivBeanIdIndex;
        byte[] beanIdBytes = new byte[beanIdLength];
        System.arraycopy(data, ivBeanIdIndex, beanIdBytes, 0, beanIdLength);
        return new ByteArray(beanIdBytes);
    }
825840
public byte[] getRawData() throws IOException
    {
        int contentLength = request.getContentLength();
        if( contentLength<0 ) {
            return null;
        }
        
        byte[] buffer = new byte[contentLength];
        ServletInputStream is = request.getInputStream();
        for (int i = 0; i < contentLength; ) {
            int rLen = is.read(buffer, i, contentLength - i);
            if ( rLen == -1 ) {
                break;
            }
            
            i += rLen;
        }
        
        return buffer;
    }
880923
@Nullable
  public byte [] getAsByteArray ()
  {
    try (final NonBlockingByteArrayOutputStream aBAOS = new NonBlockingByteArrayOutputStream ())
    {
      if (writeTo (aBAOS).isFailure ())
        return null;
      return aBAOS.getBufferOrCopy ();
    }
  }
1164952
public static ByteBuf serialize(final Serializable serializable) throws Exception {
        ByteArrayOutputStream bos = new ByteArrayOutputStream();;
        ObjectOutputStream os = new ObjectOutputStream(bos);
        os.writeObject(serializable);

        byte[] serialized = bos.toByteArray();
        os.close();
        bos.close();
        return Unpooled.buffer().writeBytes(serialized);
    }
651963
public static ByteBuffer[] getWrappedByteBuffers(WsByteBuffer wsbuffers[]) {
        // Create the buffer array to return.
        ByteBuffer buffers[] = new ByteBuffer[wsbuffers.length];
        boolean foundNullBuffer = false;
        int i = 0;
        // Loop through each buffer of the input array.
        for (i = 0; i < wsbuffers.length; i++) {
            if (wsbuffers[i] != null) {
                // Populate the return buffer array with the wrapped buffers of the input array.
                buffers[i] = wsbuffers[i].getWrappedByteBuffer();
            } else {
                // Handle case where end entries of array are null.
                foundNullBuffer = true;
                break;
            }
        }
        // Check if the array needs to be shrunk down.
        if (foundNullBuffer) {
            // Need to shrink. Create temporary array to hold current contents.
            ByteBuffer tempBuffers[] = buffers;
            // Replace return buffer array with appropriately sized array.
            buffers = new ByteBuffer[i];
            for (int j = 0; j < i; j++) {
                // Populate the return buffer with only non null entries.
                buffers[j] = tempBuffers[j];
            }
        }
        return buffers;
    }
539512
@Override
    public byte[] serialize() {
        try {
            ByteArrayOutputStream out = new ByteArrayOutputStream();
            ObjectOutputStream oos = new ObjectOutputStream(out);
            oos.writeObject(map);
            return out.toByteArray();
        } catch (IOException ex) {
            throw new IllegalStateException("Unable to compress SerializableMap");
        }
    }
1215079
@Nonnull
  public static byte [] getSerializedByteArray (@Nonnull final Serializable aData)
  {
    ValueEnforcer.notNull (aData, "Data");

    try (final NonBlockingByteArrayOutputStream aBAOS = new NonBlockingByteArrayOutputStream ())
    {
      // Convert to byte array
      try (final ObjectOutputStream aOOS = new ObjectOutputStream (aBAOS))
      {
        aOOS.writeObject (aData);
      }

      // Main sending
      return aBAOS.toByteArray ();
    }
    catch (final NotSerializableException ex)
    {
      throw new IllegalArgumentException ("Not serializable: " + ex.getMessage (), ex);
    }
    catch (final IOException ex)
    {
      throw new IllegalArgumentException ("Failed to write serializable object " +
                                          aData +
                                          " of type " +
                                          aData.getClass ().getName (),
                                          ex);
    }
  }
677888
public byte[] getBytes()
	{
		byte b[] = new byte[getLength()];
		int bytesCopied = 0;

		Iterator<V> it = this.values().iterator();
		while (it.hasNext())
		{
			ID3v2Frame frame = (ID3v2Frame) it.next();
			System.arraycopy(frame.getFrameBytes(), 0, b, bytesCopied, frame.getFrameLength());
			bytesCopied += frame.getFrameLength();
		}

		return b;
	}
467781
@SuppressWarnings("unchecked")
    public BaseBo fromByteArray(byte[] data) {
        Map<String, Object> dataMap = null;
        try {
            dataMap = data != null ? SerializationUtils.fromByteArray(data, Map.class) : null;
        } catch (Exception e) {
            dataMap = null;
        }
        return fromMap(dataMap);
    }
1305952
private static CmsGallerySearchBean getSearchBeanFromDict() throws SerializationException {

        return (CmsGallerySearchBean)CmsRpcPrefetcher.getSerializedObjectFromDictionary(
            CmsGalleryController.getGalleryService(),
            CmsGallerySearchBean.DICT_NAME);
    }
215723
private byte[] getJ2EENameBytes(BeanMetaData bmd, boolean isHome)
    {
        if (!isHome && bmd.ivUnversionedJ2eeName != null) {
            return bmd.ivUnversionedJ2eeName.getBytes();
        }
        return j2eeName.getBytes();
    }
122024
public byte[] serialize() {
        byte[] value = serializeValue();
        ByteBuffer buffer = ByteBuffer.allocate(value.length + 4);
        buffer.putShort(tag);
        buffer.putShort((short)value.length);
        buffer.put(value);
        return buffer.array();
    }
1091912
public ByteBuffer serialize () {

        final int size = uncroppedSize();
        if (size == 0) return ByteBuffer.allocate(0);// empty data segment

        // calculate sense length
        int senseLength;
        if (senseData == null)
            senseLength = 0;
        else
            senseLength = senseData.size();

        // allocate buffer of appropriate size
        final ByteBuffer buffer = ByteBuffer.allocate(size);

        // write sense length field
        ReadWrite.writeTwoByteInt(buffer,// buffer
                senseLength,// value
                0);// index

        // write sense data
        if (senseData != null) senseData.serialize(buffer, SENSE_LENGTH_FIELD_LENGTH);

        // write and SCSI response data
        if (responseData != null) responseData.serialize(buffer, SENSE_LENGTH_FIELD_LENGTH + senseLength);

        if (allocationLength > 0 && buffer.capacity() > allocationLength) {
            /*
             * If the allocation length variable is valid and the response data segment is larger than the data-in
             * buffer allocated by the initiator, limit the number of bytes returned.
             */
            buffer.position(0);
            buffer.limit(allocationLength);
            final ByteBuffer croppedBuffer = ByteBuffer.allocate(allocationLength);
            croppedBuffer.put(buffer);
            return croppedBuffer;
        }

        if (LOGGER.isDebugEnabled()) LOGGER.debug("SCSI Response Data Segment:\n" + Debug.byteBufferToString(buffer));

        return buffer;
    }
1162491
private static CmsGalleryDataBean getGalleryDataFromDict() throws SerializationException {

        return (CmsGalleryDataBean)CmsRpcPrefetcher.getSerializedObjectFromDictionary(
            CmsGalleryController.getGalleryService(),
            CmsGalleryDataBean.DICT_NAME);
    }
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;
    }
1306132
public byte[] getBytes() {

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

        this.putBytes(bbuf);
        return me;
    }
565595
@JsonProperty("p")
    @JsonSerialize(using = Base64UrlJsonSerializer.class)
    @JsonDeserialize(using = Base64UrlJsonDeserializer.class)
    public byte[] p() {
        return ByteExtensions.clone(this.p);
    }