/**
* Copyright: t3am_C9 (Alexander Schäffer, Johannes Ebersold, Sebastian Geib, Thomas Kisiel)
*
* This file is part of GifToApngConverter
*
* GifToApngConverter is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GifToApngConverter is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GifToApngConverter. If not, see <a href="http://www.gnu.org/licenses/">here</a>
*/
package giftoapng;
import util.ByteBuilder;
/**
* Holds comments for the apng file
* For more information look here: <a href="http://www.w3.org/TR/PNG/">PNG-specifcation</a>
* @author tomi
*
*/
public class ChunktEXt extends Chunk
{
private String mKeyword = "";
private String mText = "";
/**
* Constructs a tEXt Chunk
*/
public ChunktEXt()
{
this("Software","Created with gif2apng V1.0 Beta");
}
public ChunktEXt(String keyword, String text)
{
mbaHeader = new Property("tEXt");
mKeyword = keyword;
mText = text;
}
@Override
protected byte[] getData()
{
ByteBuilder bb = new ByteBuilder();
bb.appendArray(mKeyword.getBytes());
bb.appendSingle(0);
bb.appendArray(mText.getBytes());
return bb.getArray();
}
}