@Override
public List<BufferedImage> getAllBufferedImages(final ByteSource byteSource)
throws ImageReadException, IOException {
final DcxHeader dcxHeader = readDcxHeader(byteSource);
final List<BufferedImage> images = new ArrayList<BufferedImage>();
final PcxImageParser pcxImageParser = new PcxImageParser();
for (final long element : dcxHeader.pageTable) {
InputStream stream = null;
boolean canThrow = false;
try {
stream = byteSource.getInputStream(element);
final ByteSourceInputStream pcxSource = new ByteSourceInputStream(
stream, null);
final BufferedImage image = pcxImageParser.getBufferedImage(
pcxSource, new HashMap<String, Object>());
images.add(image);
canThrow = true;
} finally {
IoUtils.closeQuietly(canThrow, stream);