68b3bea33b449d541af183236e7b618ebebc851d
[imagesqueeze.git] / src / main / java / eu / svjatoslav / imagesqueeze / codec / ImageMetaData.java
1 package eu.svjatoslav.imagesqueeze.codec;
2
3 /**
4  * Class to hold image metadata.
5  * Like image dimensions, header version, compression quality, etc.. 
6  */
7
8 import java.io.IOException;
9
10
11 public class ImageMetaData {
12
13         int version;
14         int width;
15         int height;
16
17
18         public void load(BitInputStream inputStream) throws IOException{
19
20                 version = inputStream.readBits(16);
21                 width = inputStream.readIntegerCompressed8();
22                 height = inputStream.readIntegerCompressed8();
23
24         }
25
26         public void save(BitOutputStream outputStream) throws IOException{
27
28                 outputStream.storeBits(version, 16);
29                 outputStream.storeIntegerCompressed8(width);
30                 outputStream.storeIntegerCompressed8(height);
31
32         }
33
34 }