本文整理了Java中org.apache.sanselan.common.ZLibUtils.<init>()
方法的一些代码示例,展示了ZLibUtils.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZLibUtils.<init>()
方法的具体详情如下:
包路径:org.apache.sanselan.common.ZLibUtils
类名称:ZLibUtils
方法名:<init>
暂无
代码示例来源:origin: org.apache.sanselan/sanselan
private void writeChunkXmpiTXt(OutputStream os, String xmpXml)
throws IOException
{
ByteArrayOutputStream baos = new ByteArrayOutputStream();
// keyword
baos.write(XMP_KEYWORD.getBytes("ISO-8859-1"));
baos.write(0);
baos.write(1); // compressed flag, true
baos.write(COMPRESSION_DEFLATE_INFLATE); // compression method
baos.write(0); // language tag (ignore). TODO
// translated keyword
baos.write(XMP_KEYWORD.getBytes("utf-8"));
baos.write(0);
baos.write(new ZLibUtils().deflate(xmpXml.getBytes("utf-8")));
writeChunk(os, iTXt_CHUNK_TYPE, baos.toByteArray());
}
代码示例来源:origin: fr.opensagres.xdocreport.appengine-awt/appengine-awt
private void writeChunkXmpiTXt(OutputStream os, String xmpXml)
throws IOException
{
ByteArrayOutputStream baos = new ByteArrayOutputStream();
// keyword
baos.write(XMP_KEYWORD.getBytes("ISO-8859-1"));
baos.write(0);
baos.write(1); // compressed flag, true
baos.write(COMPRESSION_DEFLATE_INFLATE); // compression method
baos.write(0); // language tag (ignore). TODO
// translated keyword
baos.write(XMP_KEYWORD.getBytes("utf-8"));
baos.write(0);
baos.write(new ZLibUtils().deflate(xmpXml.getBytes("utf-8")));
writeChunk(os, iTXt_CHUNK_TYPE, baos.toByteArray());
}
代码示例来源:origin: fr.opensagres.xdocreport.appengine-awt/appengine-awt
private void writeChunkiTXt(OutputStream os, PngText.iTXt text)
throws IOException, ImageWriteException
{
if (!UnicodeUtils.isValidISO_8859_1(text.keyword))
throw new ImageWriteException(
"Png tEXt chunk keyword is not ISO-8859-1: " + text.keyword);
if (!UnicodeUtils.isValidISO_8859_1(text.languageTag))
throw new ImageWriteException(
"Png tEXt chunk language tag is not ISO-8859-1: "
+ text.languageTag);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
// keyword
baos.write(text.keyword.getBytes("ISO-8859-1"));
baos.write(0);
baos.write(1); // compressed flag, true
baos.write(COMPRESSION_DEFLATE_INFLATE); // compression method
// language tag
baos.write(text.languageTag.getBytes("ISO-8859-1"));
baos.write(0);
// translated keyword
baos.write(text.translatedKeyword.getBytes("utf-8"));
baos.write(0);
baos.write(new ZLibUtils().deflate(text.text.getBytes("utf-8")));
writeChunk(os, iTXt_CHUNK_TYPE, baos.toByteArray());
}
代码示例来源:origin: org.apache.sanselan/sanselan
private void writeChunkiTXt(OutputStream os, PngText.iTXt text)
throws IOException, ImageWriteException
{
if (!UnicodeUtils.isValidISO_8859_1(text.keyword))
throw new ImageWriteException(
"Png tEXt chunk keyword is not ISO-8859-1: " + text.keyword);
if (!UnicodeUtils.isValidISO_8859_1(text.languageTag))
throw new ImageWriteException(
"Png tEXt chunk language tag is not ISO-8859-1: "
+ text.languageTag);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
// keyword
baos.write(text.keyword.getBytes("ISO-8859-1"));
baos.write(0);
baos.write(1); // compressed flag, true
baos.write(COMPRESSION_DEFLATE_INFLATE); // compression method
// language tag
baos.write(text.languageTag.getBytes("ISO-8859-1"));
baos.write(0);
// translated keyword
baos.write(text.translatedKeyword.getBytes("utf-8"));
baos.write(0);
baos.write(new ZLibUtils().deflate(text.text.getBytes("utf-8")));
writeChunk(os, iTXt_CHUNK_TYPE, baos.toByteArray());
}
代码示例来源:origin: fr.opensagres.xdocreport.appengine-awt/appengine-awt
public PNGChunkzTXt(int length, int chunkType, int crc, byte bytes[])
throws ImageReadException, IOException
{
super(length, chunkType, crc, bytes);
{
int index = findNull(bytes);
if (index < 0)
throw new ImageReadException(
"PNG zTXt chunk keyword is unterminated.");
keyword = new String(bytes, 0, index, "ISO-8859-1");
index++;
int compressionMethod = bytes[index++];
if (compressionMethod != PngConstants.COMPRESSION_DEFLATE_INFLATE)
throw new ImageReadException(
"PNG zTXt chunk has unexpected compression method: "
+ compressionMethod);
int compressedTextLength = bytes.length - index;
byte compressedText[] = new byte[compressedTextLength];
System.arraycopy(bytes, index, compressedText, 0,
compressedTextLength);
text = new String(new ZLibUtils().inflate(compressedText),
"ISO-8859-1");
}
}
代码示例来源:origin: org.apache.sanselan/sanselan
public PNGChunkzTXt(int length, int chunkType, int crc, byte bytes[])
throws ImageReadException, IOException
{
super(length, chunkType, crc, bytes);
{
int index = findNull(bytes);
if (index < 0)
throw new ImageReadException(
"PNG zTXt chunk keyword is unterminated.");
keyword = new String(bytes, 0, index, "ISO-8859-1");
index++;
int compressionMethod = bytes[index++];
if (compressionMethod != PngConstants.COMPRESSION_DEFLATE_INFLATE)
throw new ImageReadException(
"PNG zTXt chunk has unexpected compression method: "
+ compressionMethod);
int compressedTextLength = bytes.length - index;
byte compressedText[] = new byte[compressedTextLength];
System.arraycopy(bytes, index, compressedText, 0,
compressedTextLength);
text = new String(new ZLibUtils().inflate(compressedText),
"ISO-8859-1");
}
}
代码示例来源:origin: fr.opensagres.xdocreport.appengine-awt/appengine-awt
private void writeChunkzTXt(OutputStream os, PngText.zTXt text)
throws IOException, ImageWriteException
{
if (!UnicodeUtils.isValidISO_8859_1(text.keyword))
throw new ImageWriteException(
"Png zTXt chunk keyword is not ISO-8859-1: " + text.keyword);
if (!UnicodeUtils.isValidISO_8859_1(text.text))
throw new ImageWriteException(
"Png zTXt chunk text is not ISO-8859-1: " + text.text);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
// keyword
baos.write(text.keyword.getBytes("ISO-8859-1"));
baos.write(0);
// compression method
baos.write(PngConstants.COMPRESSION_DEFLATE_INFLATE);
// text
baos
.write(new ZLibUtils().deflate(text.text
.getBytes("ISO-8859-1")));
writeChunk(os, zTXt_CHUNK_TYPE, baos.toByteArray());
}
代码示例来源:origin: org.apache.sanselan/sanselan
private void writeChunkzTXt(OutputStream os, PngText.zTXt text)
throws IOException, ImageWriteException
{
if (!UnicodeUtils.isValidISO_8859_1(text.keyword))
throw new ImageWriteException(
"Png zTXt chunk keyword is not ISO-8859-1: " + text.keyword);
if (!UnicodeUtils.isValidISO_8859_1(text.text))
throw new ImageWriteException(
"Png zTXt chunk text is not ISO-8859-1: " + text.text);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
// keyword
baos.write(text.keyword.getBytes("ISO-8859-1"));
baos.write(0);
// compression method
baos.write(PngConstants.COMPRESSION_DEFLATE_INFLATE);
// text
baos
.write(new ZLibUtils().deflate(text.text
.getBytes("ISO-8859-1")));
writeChunk(os, zTXt_CHUNK_TYPE, baos.toByteArray());
}
代码示例来源:origin: org.apache.sanselan/sanselan
UncompressedProfile = new ZLibUtils()
.inflate(CompressedProfile);
代码示例来源:origin: fr.opensagres.xdocreport.appengine-awt/appengine-awt
UncompressedProfile = new ZLibUtils()
.inflate(CompressedProfile);
代码示例来源:origin: fr.opensagres.xdocreport.appengine-awt/appengine-awt
compressedTextLength);
text = new String(new ZLibUtils().inflate(compressedText),
"utf-8");
代码示例来源:origin: org.apache.sanselan/sanselan
compressedTextLength);
text = new String(new ZLibUtils().inflate(compressedText),
"utf-8");
内容来源于网络,如有侵权,请联系作者删除!