2 * Imagesqueeze - Image codec optimized for photos.
3 * Copyright (C) 2012, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of version 2 of the GNU General Public License
7 * as published by the Free Software Foundation.
10 package eu.svjatoslav.imagesqueeze.codec;
13 * Class to hold image metadata.
14 * Like image dimensions, header version, compression quality, etc..
17 import java.io.IOException;
19 import eu.svjatoslav.commons.data.BitInputStream;
20 import eu.svjatoslav.commons.data.BitOutputStream;
22 public class ImageMetaData {
28 public void load(final BitInputStream inputStream) throws IOException {
30 version = inputStream.readBits(16);
31 width = inputStream.readIntegerCompressed8();
32 height = inputStream.readIntegerCompressed8();
36 public void save(final BitOutputStream outputStream) throws IOException {
38 outputStream.storeBits(version, 16);
39 outputStream.storeIntegerCompressed8(width);
40 outputStream.storeIntegerCompressed8(height);