Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.
Mircea Anton edited this page Feb 12, 2021 · 1 revision

BmpIO

This class is responsible for all the IO operations that concern *.bmp images.

Description

This class is built with the Singleton pattern, and as such, only one instance of it can exist at a time in the app. This instance can be accessed via the getInstance() method.

A given Image is saved on disk via the write(Image, String) method. This method is nothing more than a wrapper for ImageIo.write().

In order to read an image, the read() method initates this process by starting 2 threads, a Producer and a Consumer. The producer then reads the file bit by bit, and puts the data into a BlockingQueue. The consumer reads those bits and builds the bmp image in a BitmapImage object.

Being a class that extends GenericJob, the execution time is monitored in the read() method via the Timer singleton.

Clone this wiki locally