@Override
    public ByteSource getGraphics(final String username) {
        try (val resourceStream = graphicResource.get(username).getInputStream();
             val bos = new ByteArrayOutputStream()) {
            IOUtils.copy(resourceStream, bos);
            return ByteSource.wrap(bos.toByteArray());
        } catch (final Exception e) {
            LoggingUtils.error(LOGGER, e);
        }
        return ByteSource.empty();
    }
This is {@link StaticUserGraphicalAuthenticationRepository}.

@author Misagh Moayyed
@since 5.1.0
support/cas-server-support-gua/src/main/java/org/apereo/cas/gua/impl/StaticUserGraphicalAuthenticationRepository.java