@SuppressWarnings("resource") // @see ResourceDecoder.decode @Override public Resource<ImageWrapper> decode(ImageVideoWrapper source, int width, int height) throws IOException { ByteArrayPool pool = ByteArrayPool.get(); byte[] tempBytes = pool.getBytes(); ImageWrapper wrapper = null; try { wrapper = decode(source, width, height, tempBytes); } finally { pool.releaseBytes(tempBytes); } return wrapper != null ? new ImageWrapperResource(wrapper) : null; }