class OptimizedObjectStreamRegistry {
    /**
     * Gets output stream.
     *
     * @return Object output stream.
     * @throws org.apache.ignite.internal.IgniteInterruptedCheckedException If thread is interrupted while trying to take holder from pool.
     */
    abstract OptimizedObjectOutputStream out() throws IgniteInterruptedCheckedException;

    /**
     * Gets input stream.
     *
     * @return Object input stream.
     * @throws org.apache.ignite.internal.IgniteInterruptedCheckedException If thread is interrupted while trying to take holder from pool.
     */
    abstract OptimizedObjectInputStream in() throws IgniteInterruptedCheckedException;

    /**
     * Closes and releases output stream.
     *
     * @param out Object output stream.
     */
    abstract void closeOut(OptimizedObjectOutputStream out);

    /**
     * Closes and releases input stream.
     *
     * @param in Object input stream.
     */
    abstract void closeIn(OptimizedObjectInputStream in);

    /**
     * Creates output stream.
     *
     * @return Object output stream.
     */
    static OptimizedObjectOutputStream createOut() {
        try {
            return new OptimizedObjectOutputStream(new GridUnsafeDataOutput(4 * 1024));
        }
        catch (IOException e) {
            throw new IgniteException("Failed to create object output stream.", e);
        }
    }

    /**
     * Creates input stream.
     *
     * @return Object input stream.
     */
    static OptimizedObjectInputStream createIn() {<FILL_FUNCTION_BODY>}
}

        try {
            return new OptimizedObjectInputStream(new GridUnsafeDataInput());
        }
        catch (IOException e) {
            throw new IgniteException("Failed to create object input stream.", e);
        }
    
<no_super_class>