code: public byte[] toByteArray(final Object object) throws IOException {
  		final ByteArrayOutputStream out = new ByteArrayOutputStream();
  		write(object, out);
  		return out.toByteArray();
  	}
docs: Serializes the given {@code object} to a {@code byte[]} array.
  
  @since 4.1
  
  @param object the object to serialize.
  @throws NullPointerException if one of the object is {@code null}.
  @throws IOException if the object could not be serialized.
  @return the serialized {@code object} as {@code byte[]} array