class BlobSerializer extends LobSerializer {

  public static final String TYPE_OF_DATA_FOR_DB = "BINARY";

  public BlobSerializer() throws SQLException {
    super(TYPE_OF_DATA_FOR_DB);
  }

  /**
   * Serializes the input object graph to its Binary Representation using Object Stream.
   *
   * @param toSerialize Object which is to be serialized
   * @return Serialized object
   * @throws IOException {@inheritDoc}
   */
  @Override
  public Object serialize(Forest toSerialize) throws IOException {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    ObjectOutputStream oos = new ObjectOutputStream(baos);
    oos.writeObject(toSerialize);
    oos.close();
    return new ByteArrayInputStream(baos.toByteArray());
  }

  /**
   * Deserializes the input Byte Array Stream using Object Stream and return its Object Graph
   * Representation.
   *
   * @param toDeserialize Input Object to De-serialize
   * @return Deserialized Object
   * @throws ClassNotFoundException {@inheritDoc}
   * @throws IOException            {@inheritDoc}
   */
  @Override
  public Forest deSerialize(Object toDeserialize) throws IOException, ClassNotFoundException {<FILL_FUNCTION_BODY>}
}

    InputStream bis = (InputStream) toDeserialize;
    Forest forest;
    try (ObjectInput in = new ObjectInputStream(bis)) {
      forest = (Forest) in.readObject();
    }
    return forest;
  
<methods>public void close() ,public abstract com.iluwatar.slob.lob.Forest deSerialize(java.lang.Object) throws javax.xml.parsers.ParserConfigurationException, java.io.IOException, org.xml.sax.SAXException, java.lang.ClassNotFoundException,public java.lang.Object loadFromDb(int, java.lang.String) throws java.sql.SQLException,public int persistToDb(int, java.lang.String, java.lang.Object) throws java.sql.SQLException,public abstract java.lang.Object serialize(com.iluwatar.slob.lob.Forest) throws javax.xml.parsers.ParserConfigurationException, javax.xml.transform.TransformerException, java.io.IOException<variables>private final transient non-sealed com.iluwatar.slob.dbservice.DatabaseService databaseService