code: protected final synchronized byte[] objectToArray(Object val) throws IOException {
          final ByteArrayOutputStream bos = new InitiallyReusableByteArrayOutputStream(getReusableByteBuffer());
          final ObjectOutputStream oos = new ObjectOutputStream(bos);
          oos.writeObject(val);
  
          return bos.toByteArray();
      }
docs: Converts an object to byte array.
  
  @param val The object to convert.
  @return The byte array representation of the object.
  @throws IOException If the buffer is not enough to make the conversion.