@Override
    public byte[] encodeObject(final Object objContent) throws IOException {
        ByteArrayOutputStream baos = null;
        ObjectOutputStream output = null;
        try {
            baos = new ByteArrayOutputStream(1024);
            output = new ObjectOutputStream(baos);
            output.writeObject(objContent);
        }
        catch (final IOException ex) {
            throw ex;

        }
        finally {
            if (output != null) {
                try {
                    output.close();
                    if (baos != null) {
                        baos.close();
                    }
                }
                catch (final IOException ex) {
                    this.logger.error("Failed to close stream.", ex);
                }
            }
        }
        return baos != null ? baos.toByteArray() : null;
    }
@see com.taobao.notify.codec.Serializer#encodeObject(Object)
metamorphosis-commons/src/main/java/com/taobao/metamorphosis/utils/codec/impl/JavaSerializer.java