/*
* Imagesqueeze - Image codec optimized for photos.
* Copyright (C) 2012, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public License
* as published by the Free Software Foundation.
/**
* Class to hold image metadata.
- * Like image dimensions, header version, compression quality, etc..
+ * Like image dimensions, header version, compression quality, etc..
*/
import java.io.IOException;
int height;
public void load(final BitInputStream inputStream) throws IOException {
-
version = inputStream.readBits(16);
- width = inputStream.readIntegerCompressed8();
- height = inputStream.readIntegerCompressed8();
-
+ width = ImageDecoder.readIntegerCompressed8(inputStream);
+ height = ImageDecoder.readIntegerCompressed8(inputStream);
}
public void save(final BitOutputStream outputStream) throws IOException {
-
outputStream.storeBits(version, 16);
- outputStream.storeIntegerCompressed8(width);
- outputStream.storeIntegerCompressed8(height);
-
+ ImageEncoder.storeIntegerCompressed8(outputStream, width);
+ ImageEncoder.storeIntegerCompressed8(outputStream, height);
}
}