shillelagh/src/main/java/shillelagh/internal/ShillelaghUtil.java
public static <T> byte[] serialize(T object) {
    try {
      ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
      ObjectOutputStream objectOutputStream = new ObjectOutputStream(byteArrayOutputStream);
      objectOutputStream.writeObject(object);
      return byteArrayOutputStream.toByteArray();
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }
public static <T> byte[] serialize(T object) {
    try {
      ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
      ObjectOutputStream objectOutputStream = new ObjectOutputStream(byteArrayOutputStream);
      objectOutputStream.writeObject(object);
      return byteArrayOutputStream.toByteArray();
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }
public static < T > byte [ ] serialize ( T object ) { try { ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream ( ) ; ObjectOutputStream objectOutputStream = new ObjectOutputStream ( byteArrayOutputStream ) ; objectOutputStream . writeObject ( object ) ; return byteArrayOutputStream . toByteArray ( ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } }
Takes an object and serializes it to a byte array. Don't enforce that it extends serializable
to allow for lists and maps to be passed in.

@param object The object to serialize. Must implement {@link java.io.Serializable}
@return The object as a byte array.
Takes an object and serializes it to a byte array . Don t enforce that it extends serializable to allow for lists and maps to be passed in .