code: private static void serialize(Serializable object, OutputStream output) throws IOException {
          BufferedOutputStream bos = new BufferedOutputStream(output);
          ObjectOutputStream oos = new ObjectOutputStream(bos);
          oos.writeObject(object);
          bos.flush();
      }
docs: Serializes an {@code Serializable} to the specified stream.
  
  The given stream will not be close.
  
  @param object the object to serialize to bytes
  @param output the stream to write to, must not be null
  @throws IOException in case the load operation failed